wnck_screen_get_default() in panel plugin

Dani dani at damufo.com
Tue Nov 19 13:03:30 CET 2019


Hi Simon,

First, very thanks!

I agree, it's a better feature for a standalone application.



I would love to know how to make standalone applications but my 
knowledge in this field are not what I would like.

I currently use brigtside, which is very old and disappears in debian 
buster ... it has gnomeui dependencies.

My idea is to migrate to gtk3 also brigtside, precisely from what you 
comment (standalone app), i'm trying it harder without help i don't know 
if i will get it.


The problem line is in hotcorner.c
line 771
WnckScreen *screenwnck = wnck_screen_get_default ();


For test
$ git clone https://github.com/damufo/xfce4-hotcorner-plugin.git
$ cd xfce4-hotcorner-plugin
$ cmake -DCMAKE_INSTALL_PREFIX=/usr .
$ sudo make install

then I should appear to add to the panel but before adding it, I open a 
terminal and put:
$ xfce4-panel -q
$ PANEL_DEBUG = 1 xfce4-panel

and this is when I add the hotcorner-plugin to the panel.

Very thanks!!


Dani

O 19/11/19 ás 10:01, Simon Steinbeiss escribiu:
> Hi,
>
> to get a bit more context - where's the code for this plugin?
> To be honest I don't know this plugin, it's not on git.xfce (which 
> doesn't mean it doesn't exist ofc).
>
> Also in terms of the functionality I don't understand why this is 
> implemented as a plugin to the panel and not a simple standalone 
> service. There's no need to see the plugin at all times in a panel and 
> the functionality isn't related to the panel at all...
>
> Cheers
> Simon
>
>
> On Mon, Nov 18, 2019 at 9:27 PM Dani <dani at damufo.com 
> <mailto:dani at damufo.com>> wrote:
>
>     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
>
>
>
>     _______________________________________________
>     Xfce4-dev mailing list
>     Xfce4-dev at xfce.org <mailto: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





More information about the Xfce4-dev mailing list