Get gdk_display_get_primary_monitor

Alexis BRENON @Xfce brenon.alexis+xfce at gmail.com
Mon Nov 18 08:02:05 CET 2019


I don't know much about GTK3 lib, but is a default screen always defined? I
know that on Arch, with Xfce I can set up a dual monitor setup without
defining any "Primary screen". I don't know if both (default monitor and
primary screen) are linked.

Alexis.


Le lun. 18 nov. 2019 06:32, Milan Martikán <milan.martikan at gmail.com> a
écrit :

> Is gtk_init() called before?
>
> Milan
>
> On Mon, Nov 18, 2019 at 2:49 AM Dani <dani at damufo.com> wrote:
> >
> > 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
> >
> >
> >
> > _______________________________________________
> > Xfce4-dev mailing list
> > Xfce4-dev at xfce.org
> > https://mail.xfce.org/mailman/listinfo/xfce4-dev
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> https://mail.xfce.org/mailman/listinfo/xfce4-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.xfce.org/pipermail/xfce4-dev/attachments/20191118/1faf3860/attachment.html>


More information about the Xfce4-dev mailing list