wnck_screen_get_default() in panel plugin

Dani dani at damufo.com
Mon Nov 18 21:27:21 CET 2019


Hello:

In a panel plugin
xfce4-panel(main): version 4.12.1 on gtk+ 2.24.31 (2.24.31), glib 2.50.3 
(2.50.2)

PKG_CHECK_MODULES(GTK REQUIRED libxfce4panel-1.0 libxfce4ui-1 libwnck-3.0)
also
PKG_CHECK_MODULES(GTK3 REQUIRED gtk+-3.0 libxfce4panel-2.0 libxfce4ui-2 
libwnck-3.0)


#define WNCK_I_KNOW_THIS_IS_UNSTABLE  1
#include <libwnck/libwnck.h>


static void constructor(XfcePanelPlugin *plugin) {
     HotCorner * hotCorner = hotCorner_new(plugin);
     xfce_textdomain(GETTEXT_PACKAGE, LOCALEDIR, "UTF-8");
     set_monitor_size(hotCorner);
     xfce_panel_plugin_menu_show_configure (plugin);

     WnckScreen *screenwnck = wnck_screen_get_default ();
...




This line:
WnckScreen *screen = wnck_screen_get_default ();

when
$ PANEL_DEBUG=1 xfce4-panel


(wrapper-1.0:27298): GLib-GObject-WARNING **: cannot register existing 
type 'GdkDisplay'

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

(wrapper-1.0:27298): GLib-GObject-CRITICAL **: g_type_register_static: 
assertion 'parent_type > 0' failed

(wrapper-1.0:27298): GLib-GObject-CRITICAL **: 
g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE 
(instance_type)' failed

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





This line
GdkScreen * screen = gdk_screen_get_default();
work fine.

This is a bug?
Any idea how to make it work?

-- 
Dani





More information about the Xfce4-dev mailing list