Get gdk_display_get_primary_monitor

Dani dani at damufo.com
Mon Nov 18 02:34:11 CET 2019


Hi,

I'm trying to pass the hotcorner plugin to gtk3.

I have encountered a problem that I have not solved, maybe someone can 
help me.

I need to get the screen (work area where the cursor is) dimensions.
With gtk2 I used gdk_screen_get_monitor_geometry() but with gtk3 so I 
can't use it now:


     display = gdk_display_get_default();
     monitor = gdk_display_get_primary_monitor(display);
     gdk_monitor_get_geometry (monitor, &geometry);
     hotCorner->monitorInfo = geometry;


The thing is, when you add the plugin to the panel the following error:


(wrapper-1.0:2593): GLib-CRITICAL **: g_once_init_leave: assertion 
'result != 0' failed

(wrapper-1.0:2593): Gdk-CRITICAL **: gdk_display_get_primary_monitor: 
assertion 'GDK_IS_DISPLAY (display)' failed

(wrapper-1.0:2593): Gdk-CRITICAL **: gdk_monitor_get_workarea: assertion 
'GDK_IS_MONITOR (monitor)' failed

I tried this on:

xfce4-panel(main): version 4.12.1 on gtk+ 2.24.31 (2.24.31), glib 2.50.3 
(2.50.2)
same with
xfce4-panel(main): version 4.14.1 on gtk+ 3.24.12 (3.24.11), glib 2.62.1 
(2.62.0)

and they produce the same error.

Very thanks.


-- 
Dani





More information about the Xfce4-dev mailing list