Comments (2)
Closing and posting patch here.
diff -rupN --exclude .git gtkdialog.orig/src/widget_text.c gtkdialog/src/widget_text.c
--- gtkdialog.orig/src/widget_text.c 2021-10-12 06:01:29.002399093 +1000
+++ gtkdialog/src/widget_text.c 2021-10-11 20:53:24.533174394 +1000
@@ -22,6 +22,7 @@
/* Includes */
#define _GNU_SOURCE
#include <gtk/gtk.h>
+#include <gdk/gdkwayland.h>
#include "config.h"
#include "gtkdialog.h"
#include "attributes.h"
@@ -93,16 +94,20 @@ GtkWidget *widget_text_create(
#if GTK_CHECK_VERSION(3,2,2) /* gtk3: try global max-width-chars fix */
GdkDisplay * display = gdk_display_get_default();
- GdkMonitor * monitor = gdk_display_get_primary_monitor(display);
- int scale = gdk_monitor_get_scale_factor(monitor);
- GdkRectangle workarea = {0};
- gdk_monitor_get_workarea(monitor,&workarea);
- int width = workarea.width / scale;
int max_width;
- if ( width >= 1920 ) { /* make gui narrrower on wide screens*/
- max_width = width / 24;
+ if (GDK_IS_WAYLAND_DISPLAY (display)) {
+ max_width = 100; /* arbitrary but should be sane */
} else {
- max_width = width / 16;
+ GdkMonitor * monitor = gdk_display_get_primary_monitor(display);
+ int scale = gdk_monitor_get_scale_factor(monitor);
+ GdkRectangle workarea = {0};
+ gdk_monitor_get_workarea(monitor,&workarea);
+ int width = workarea.width / scale;
+ if ( width >= 1920 ) { /* make gui narrrower on wide screens*/
+ max_width = width / 24;
+ } else {
+ max_width = width / 16;
+ }
}
gtk_label_set_max_width_chars(GTK_LABEL(widget), max_width);
#endif
from gtkdialog.
Issue still needs fixing, so new PR soon, no new dependencies.
from gtkdialog.
Related Issues (20)
- gtk-layer-shell support - wayland/wlroots HOT 1
- gtkdialog throws warnings under X under cage HOT 7
- Simple examples not working
- all links are broken in wiki and docs
- docs need updating HOT 5
- attributeset_get_first(): set is NULL (gtk3 terminal widget)
- release `gtkdialog-0.8.5`
- menu item is rendered only partially
- gtk3 vte2 fg/bg/cursor color VTE-CRITICAL error HOT 3
- Last call for last minute inclusions for v0.8.5 HOT 9
- Build failure of 0.8.5 with autotools HOT 1
- gtk3 entry has-frame=false makes no visual difference
- Box using scrollable property in Gtk3 fails HOT 8
- Build Dependencies for Debian and Red-Hat HOT 3
- Debian package? HOT 4
- width-request and height-request not working on GTK3 version HOT 3
- gtkdialog.info file is not installed by meson
- Install location of Documentation
- make error with implicit declaration of function HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtkdialog.