Author: kelnos
Date: 2008-04-26 15:42:39 +0000 (Sat, 26 Apr 2008)
New Revision: 26890

Modified:
   xfdesktop/trunk/configure.ac.in
   xfdesktop/trunk/settings/backdrop-list-manager.c
   xfdesktop/trunk/src/Makefile.am
   xfdesktop/trunk/src/windowlist.c
   xfdesktop/trunk/src/xfce-desktop.c
   xfdesktop/trunk/src/xfdesktop-icon-view.c
   xfdesktop/trunk/src/xfdesktop-window-icon-manager.c
   xfdesktop/trunk/src/xfdesktop-window-icon.c
   xfdesktop/trunk/src/xfdesktop-window-icon.h
Log:
nick's netk->wnck patch, with some bugfixes and crash fixes (bug 3487)


Modified: xfdesktop/trunk/configure.ac.in
===================================================================
--- xfdesktop/trunk/configure.ac.in     2008-04-23 21:24:33 UTC (rev 26889)
+++ xfdesktop/trunk/configure.ac.in     2008-04-26 15:42:39 UTC (rev 26890)
@@ -19,6 +19,7 @@
 m4_define([exo_minimum_version], [0.3.2])
 m4_define([thunar_minimum_version], [0.8.0])
 m4_define([dbus_minimum_version], [0.34])
+m4_define([wnck_minimum_version], [2.12])
 m4_define([intltool_minimum_version], [0.31])
 m4_define([autoconf_minimum_version], [2.50])
 
@@ -69,6 +70,7 @@
 XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [xfce_minimum_version])
 XDT_CHECK_PACKAGE([LIBXFCE4MCS_CLIENT],  [libxfce4mcs-client-1.0],
                   [xfce_minimum_version])
+XDT_CHECK_PACKAGE([LIBWNCK], [libwnck-1.0], [wnck_minimum_version])
 XDT_XFCE_MCS_PLUGIN([XFCE_MCS_MANAGER], [xfce_minimum_version])
 
 dnl do we want desktop icons at all?

Modified: xfdesktop/trunk/settings/backdrop-list-manager.c
===================================================================
--- xfdesktop/trunk/settings/backdrop-list-manager.c    2008-04-23 21:24:33 UTC 
(rev 26889)
+++ xfdesktop/trunk/settings/backdrop-list-manager.c    2008-04-26 15:42:39 UTC 
(rev 26890)
@@ -52,6 +52,10 @@
 #define PATH_MAX 256
 #endif
 
+#include <gdk/gdkx.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+
 #include <libxfce4mcs/mcs-manager.h>
 #include <libxfce4util/libxfce4util.h>
 #include <libxfcegui4/libxfcegui4.h>

Modified: xfdesktop/trunk/src/Makefile.am
===================================================================
--- xfdesktop/trunk/src/Makefile.am     2008-04-23 21:24:33 UTC (rev 26889)
+++ xfdesktop/trunk/src/Makefile.am     2008-04-26 15:42:39 UTC (rev 26890)
@@ -52,6 +52,7 @@
 xfdesktop_CFLAGS = \
        -I$(top_srcdir) \
        -I$(top_srcdir)/common  \
+       -DWNCK_I_KNOW_THIS_IS_UNSTABLE \
        -DBINDIR=\"$(bindir)\" \
        -DLOCALEDIR=\"$(localedir)\" \
        -DDATADIR=\"$(datadir)\" \
@@ -61,9 +62,9 @@
        $(GTHREAD_CFLAGS) \
        $(GMODULE_CFLAGS) \
        $(LIBXFCEGUI4_CFLAGS) \
-       $(LIBXFCE4MCS_CLIENT_CFLAGS)
+       $(LIBXFCE4MCS_CLIENT_CFLAGS) \
+       $(LIBWNCK_CFLAGS)
 
-
 xfdesktop_LDFLAGS = \
        -export-dynamic
 
@@ -78,7 +79,8 @@
        $(LIBX11_LIBS) \
        $(GTHREAD_LIBS) \
        $(LIBXFCEGUI4_LIBS) \
-       $(LIBXFCE4MCS_CLIENT_LIBS)
+       $(LIBXFCE4MCS_CLIENT_LIBS) \
+       $(LIBWNCK_LIBS)
 
 
 if ENABLE_DESKTOP_ICONS

Modified: xfdesktop/trunk/src/windowlist.c
===================================================================
--- xfdesktop/trunk/src/windowlist.c    2008-04-23 21:24:33 UTC (rev 26889)
+++ xfdesktop/trunk/src/windowlist.c    2008-04-26 15:42:39 UTC (rev 26890)
@@ -34,8 +34,9 @@
 #include <string.h>
 #endif
 
+#include <gdk/gdkx.h>
 #include <gtk/gtk.h>
-
+#include <libwnck/libwnck.h>
 #include <libxfce4util/libxfce4util.h>
 #include <libxfcegui4/libxfcegui4.h>
 
@@ -86,11 +87,13 @@
 static void
 activate_window(GtkWidget *w, gpointer user_data)
 {
-    NetkWindow *netk_window = user_data;
+    WnckWindow *wnck_window = user_data;
     
-    if(!netk_window_is_sticky(netk_window))
-        netk_workspace_activate(netk_window_get_workspace(netk_window));
-    netk_window_activate(netk_window);
+    if(!wnck_window_is_sticky(wnck_window)) {
+        wnck_workspace_activate(wnck_window_get_workspace(wnck_window),
+                                gtk_get_current_event_time());
+    }
+    wnck_window_activate(wnck_window, gtk_get_current_event_time());
 }
 
 static void
@@ -129,40 +132,40 @@
 }
 
 static GtkWidget *
-menu_item_from_netk_window(NetkWindow *netk_window, gint icon_width,
+menu_item_from_wnck_window(WnckWindow *wnck_window, gint icon_width,
         gint icon_height)
 {
     GtkWidget *mi, *img = NULL;
     gchar *title;
-    NetkScreen *netk_screen;
-    NetkWorkspace *netk_workspace, *active_workspace;
+    WnckScreen *wnck_screen;
+    WnckWorkspace *wnck_workspace, *active_workspace;
     GString *label;
     GdkPixbuf *icon, *tmp;
     gint w, h;
     gboolean truncated = FALSE;
 
-    title = g_markup_escape_text(netk_window_get_name(netk_window), -1);
+    title = g_markup_escape_text(wnck_window_get_name(wnck_window), -1);
     if(!title)
         return NULL;
 
     label = g_string_new(title);
     g_free(title);
 
-    netk_screen = netk_window_get_screen(netk_window);
-    active_workspace = netk_screen_get_active_workspace(netk_screen);
-    netk_workspace = netk_window_get_workspace(netk_window);
+    wnck_screen = wnck_window_get_screen(wnck_window);
+    active_workspace = wnck_screen_get_active_workspace(wnck_screen);
+    wnck_workspace = wnck_window_get_workspace(wnck_window);
 
-    if(netk_window_is_active(netk_window)) {
+    if(wnck_window_is_active(wnck_window)) {
         g_string_prepend(label, "<i>");
         g_string_append(label, "</i>");
     }
-    if(netk_window_is_minimized(netk_window)) {
+    if(wnck_window_is_minimized(wnck_window)) {
         g_string_prepend(label, "[");
         g_string_append(label, "]");
     }
     
     if(show_windowlist_icons) {
-        icon = netk_window_get_icon(netk_window);
+        icon = wnck_window_get_icon(wnck_window);
         w = gdk_pixbuf_get_width(icon);
         h = gdk_pixbuf_get_height(icon);
         if(w != icon_width || h != icon_height) {
@@ -197,13 +200,13 @@
     GdkScreen *gscreen;
     GList *menu_children;
     GtkStyle *style;
-    NetkScreen *netk_screen;
+    WnckScreen *wnck_screen;
     gint nworkspaces, i;
-    NetkWorkspace *active_workspace, *netk_workspace;
+    WnckWorkspace *active_workspace, *wnck_workspace;
     gchar *ws_label, *rm_label;
     const gchar *ws_name = NULL;
     GList *windows, *l;
-    NetkWindow *netk_window;
+    WnckWindow *wnck_window;
     gint w, h;
     PangoFontDescription *italic_font_desc;
     gboolean is_empty_workspace;
@@ -242,18 +245,19 @@
     gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &w, &h);
     style = gtk_widget_get_style(GTK_WIDGET(menu));
     
-    netk_screen = netk_screen_get(gdk_screen_get_number(gscreen));
-    nworkspaces = netk_screen_get_workspace_count(netk_screen);
-    active_workspace = netk_screen_get_active_workspace(netk_screen);
+    wnck_screen = wnck_screen_get(gdk_screen_get_number(gscreen));
+    wnck_screen_force_update (wnck_screen);
+    nworkspaces = wnck_screen_get_workspace_count(wnck_screen);
+    active_workspace = wnck_screen_get_active_workspace(wnck_screen);
     
     for(i = 0; i < nworkspaces; i++) {
-        netk_workspace = netk_screen_get_workspace(netk_screen, i);
+        wnck_workspace = wnck_screen_get_workspace(wnck_screen, i);
         submenu = (GtkWidget *)menu;
         
         if(wl_show_ws_names || wl_submenus) {
-            ws_name = netk_workspace_get_name(netk_workspace);
+            ws_name = wnck_workspace_get_name(wnck_workspace);
             
-            if(netk_workspace == active_workspace) {
+            if(wnck_workspace == active_workspace) {
                 if(!ws_name || atoi(ws_name) == i+1)
                     ws_label = g_strdup_printf(_("<b>Workspace %d</b>"), i+1);
                 else {
@@ -286,8 +290,8 @@
             gtk_menu_shell_append(GTK_MENU_SHELL(menu), mi);
             if(!wl_submenus) {
                 g_signal_connect_swapped(G_OBJECT(mi), "activate",
-                                         G_CALLBACK(netk_workspace_activate),
-                                         netk_workspace);
+                                         G_CALLBACK(wnck_workspace_activate),
+                                         wnck_workspace);
             }
             
             if(wl_submenus) {
@@ -301,17 +305,17 @@
             }
         }
         
-        windows = netk_screen_get_windows_stacked(netk_screen);
+        windows = wnck_screen_get_windows_stacked(wnck_screen);
         is_empty_workspace = TRUE;
         for(l = windows; l; l = l->next) {
-            netk_window = l->data;
+            wnck_window = l->data;
             
-            if((netk_window_get_workspace(netk_window) != netk_workspace
-                        && (!netk_window_is_sticky(netk_window)
+            if((wnck_window_get_workspace(wnck_window) != wnck_workspace
+                        && (!wnck_window_is_sticky(wnck_window)
                             || (wl_sticky_once
-                                && netk_workspace != active_workspace)))
-                    || netk_window_is_skip_pager(netk_window)
-                    || netk_window_is_skip_tasklist(netk_window))
+                                && wnck_workspace != active_workspace)))
+                    || wnck_window_is_skip_pager(wnck_window)
+                    || wnck_window_is_skip_tasklist(wnck_window))
             {
                 /* the window isn't on the current WS AND isn't sticky,
                  * OR,
@@ -322,13 +326,13 @@
                 continue;
             }
             
-            mi = menu_item_from_netk_window(netk_window, w, h);
+            mi = menu_item_from_wnck_window(wnck_window, w, h);
             if(!mi)
                 continue;
             is_empty_workspace = FALSE;
-            if(netk_workspace != active_workspace 
-                    && (!netk_window_is_sticky(netk_window)
-                        || netk_workspace != active_workspace))
+            if(wnck_workspace != active_workspace
+                    && (!wnck_window_is_sticky(wnck_window)
+                        || wnck_workspace != active_workspace))
             {
                 GtkWidget *lbl = gtk_bin_get_child(GTK_BIN(mi));
                 gtk_widget_modify_fg(lbl, GTK_STATE_NORMAL,
@@ -337,12 +341,12 @@
             }
             gtk_widget_show(mi);
             gtk_menu_shell_append(GTK_MENU_SHELL(submenu), mi);
-            g_object_weak_ref(G_OBJECT(netk_window),
+            g_object_weak_ref(G_OBJECT(wnck_window),
                     (GWeakNotify)window_destroyed_cb, mi);
             g_signal_connect(G_OBJECT(mi), "activate",
-                    G_CALLBACK(activate_window), netk_window);
+                    G_CALLBACK(activate_window), wnck_window);
             g_signal_connect(G_OBJECT(mi), "destroy",
-                    G_CALLBACK(mi_destroyed_cb), netk_window);
+                    G_CALLBACK(mi_destroyed_cb), wnck_window);
         }
         
         if(!wl_submenus && !is_empty_workspace) {

Modified: xfdesktop/trunk/src/xfce-desktop.c
===================================================================
--- xfdesktop/trunk/src/xfce-desktop.c  2008-04-23 21:24:33 UTC (rev 26889)
+++ xfdesktop/trunk/src/xfce-desktop.c  2008-04-26 15:42:39 UTC (rev 26890)
@@ -57,6 +57,9 @@
 #include <time.h>
 #endif
 
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+
 #include <glib.h>
 #include <gdk/gdkx.h>
 #include <gtk/gtk.h>

Modified: xfdesktop/trunk/src/xfdesktop-icon-view.c
===================================================================
--- xfdesktop/trunk/src/xfdesktop-icon-view.c   2008-04-23 21:24:33 UTC (rev 
26889)
+++ xfdesktop/trunk/src/xfdesktop-icon-view.c   2008-04-26 15:42:39 UTC (rev 
26890)
@@ -28,6 +28,9 @@
 
 #include <glib-object.h>
 
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
 #include <gdk/gdkkeysyms.h>
@@ -39,6 +42,7 @@
 
 #include "xfdesktop-icon-view.h"
 
+#include <libwnck/libwnck.h>
 #include <libxfcegui4/libxfcegui4.h>
 
 #define DEFAULT_FONT_SIZE  12
@@ -101,7 +105,7 @@
     guint icon_size;
     guint font_size;
     
-    NetkScreen *netk_screen;
+    WnckScreen *wnck_screen;
     PangoLayout *playout;
     
     GList *pending_icons;

Modified: xfdesktop/trunk/src/xfdesktop-window-icon-manager.c
===================================================================
--- xfdesktop/trunk/src/xfdesktop-window-icon-manager.c 2008-04-23 21:24:33 UTC 
(rev 26889)
+++ xfdesktop/trunk/src/xfdesktop-window-icon-manager.c 2008-04-26 15:42:39 UTC 
(rev 26890)
@@ -29,6 +29,7 @@
 #include <glib-object.h>
 
 #include <libxfcegui4/libxfcegui4.h>
+#include <libwnck/libwnck.h>
 
 #include "xfdesktop-icon-view.h"
 #include "xfdesktop-window-icon.h"
@@ -71,7 +72,7 @@
     XfdesktopIconView *icon_view;
     
     GdkScreen *gscreen;
-    NetkScreen *netk_screen;
+    WnckScreen *wnck_screen;
     
     gint nworkspaces;
     gint active_ws_num;
@@ -123,7 +124,7 @@
     switch(property_id) {
         case PROP_SCREEN:
             wmanager->priv->gscreen = g_value_peek_pointer(value);
-            wmanager->priv->netk_screen = 
netk_screen_get(gdk_screen_get_number(wmanager->priv->gscreen));
+            wmanager->priv->wnck_screen = 
wnck_screen_get(gdk_screen_get_number(wmanager->priv->gscreen));
             break;
         
         default:
@@ -188,7 +189,7 @@
 
 static XfdesktopWindowIcon *
 xfdesktop_window_icon_manager_add_icon(XfdesktopWindowIconManager *wmanager,
-                                       NetkWindow *window,
+                                       WnckWindow *window,
                                        gint ws_num)
 {
     XfdesktopWindowIcon *icon = xfdesktop_window_icon_new(window, ws_num);
@@ -214,22 +215,23 @@
 }
 
 static void
-workspace_changed_cb(NetkScreen *netk_screen,
+workspace_changed_cb(WnckScreen *wnck_screen,
+                     WnckWorkspace *previous_workspace,
                      gpointer user_data)
 {
     XfdesktopWindowIconManager *wmanager = 
XFDESKTOP_WINDOW_ICON_MANAGER(user_data);
     gint n;
-    NetkWorkspace *ws;
+    WnckWorkspace *ws;
     
-    ws = netk_screen_get_active_workspace(wmanager->priv->netk_screen);
-    if(!NETK_IS_WORKSPACE(ws)) {
-        DBG("got weird failure of netk_screen_get_active_workspace(), 
bailing");
+    ws = wnck_screen_get_active_workspace(wmanager->priv->wnck_screen);
+    if(!WNCK_IS_WORKSPACE(ws)) {
+        DBG("got weird failure of wnck_screen_get_active_workspace(), 
bailing");
         return;
     }
     
     xfdesktop_icon_view_remove_all(wmanager->priv->icon_view);
     
-    wmanager->priv->active_ws_num = n = netk_workspace_get_number(ws);
+    wmanager->priv->active_ws_num = n = wnck_workspace_get_number(ws);
     
     if(!wmanager->priv->icon_workspaces[n]->icons) {
         GList *windows, *l;
@@ -240,14 +242,14 @@
                                   NULL,
                                   (GDestroyNotify)g_object_unref);
         
-        windows = netk_screen_get_windows(wmanager->priv->netk_screen);
+        windows = wnck_screen_get_windows(wmanager->priv->wnck_screen);
         for(l = windows; l; l = l->next) {
-            NetkWindow *window = l->data;
+            WnckWindow *window = l->data;
             
-            if((ws == netk_window_get_workspace(window)
-                || netk_window_is_pinned(window))
-               && netk_window_is_minimized(window)
-               && !netk_window_is_skip_tasklist(window))
+            if((ws == wnck_window_get_workspace(window)
+                || wnck_window_is_pinned(window))
+               && wnck_window_is_minimized(window)
+               && !wnck_window_is_skip_tasklist(window))
             {
                 xfdesktop_window_icon_manager_add_icon(wmanager,
                                                        window, n);
@@ -264,16 +266,16 @@
 }
 
 static void
-workspace_created_cb(NetkScreen *netk_screen,
-                     NetkWorkspace *workspace,
+workspace_created_cb(WnckScreen *wnck_screen,
+                     WnckWorkspace *workspace,
                      gpointer user_data)
 {
     XfdesktopWindowIconManager *wmanager = user_data;
     gint ws_num, n_ws;
     
-    n_ws = netk_screen_get_workspace_count(netk_screen);
+    n_ws = wnck_screen_get_workspace_count(wnck_screen);
     wmanager->priv->nworkspaces = n_ws;
-    ws_num = netk_workspace_get_number(workspace);
+    ws_num = wnck_workspace_get_number(workspace);
     
     wmanager->priv->icon_workspaces = 
g_realloc(wmanager->priv->icon_workspaces,
                                                 sizeof(gpointer) * n_ws);
@@ -289,8 +291,8 @@
 }
 
 static void
-workspace_destroyed_cb(NetkScreen *netk_screen,
-                       NetkWorkspace *workspace,
+workspace_destroyed_cb(WnckScreen *wnck_screen,
+                       WnckWorkspace *workspace,
                        gpointer user_data)
 {
     /* TODO: check if we get workspace-destroyed before or after all the
@@ -299,9 +301,9 @@
     XfdesktopWindowIconManager *wmanager = user_data;
     gint ws_num, n_ws;
     
-    n_ws = netk_screen_get_workspace_count(netk_screen);
+    n_ws = wnck_screen_get_workspace_count(wnck_screen);
     wmanager->priv->nworkspaces = n_ws;
-    ws_num = netk_workspace_get_number(workspace);
+    ws_num = wnck_workspace_get_number(workspace);
     
     if(wmanager->priv->icon_workspaces[ws_num]->icons)
         g_hash_table_destroy(wmanager->priv->icon_workspaces[ws_num]->icons);
@@ -318,35 +320,35 @@
 }
 
 static void
-window_state_changed_cb(NetkWindow *window,
-                        NetkWindowState changed_mask,
-                        NetkWindowState new_state,
+window_state_changed_cb(WnckWindow *window,
+                        WnckWindowState changed_mask,
+                        WnckWindowState new_state,
                         gpointer user_data)
 {
     XfdesktopWindowIconManager *wmanager = user_data;
-    NetkWorkspace *ws;
+    WnckWorkspace *ws;
     gint ws_num = -1, i, max_i;
     gboolean is_add = FALSE;
     XfdesktopWindowIcon *icon;
     
     TRACE("entering");
     
-    if(!(changed_mask & (NETK_WINDOW_STATE_MINIMIZED |
-                         NETK_WINDOW_STATE_SKIP_TASKLIST)))
+    if(!(changed_mask & (WNCK_WINDOW_STATE_MINIMIZED |
+                         WNCK_WINDOW_STATE_SKIP_TASKLIST)))
     {
         return;
     }
     
     DBG("changed_mask indicates an action");
     
-    ws = netk_window_get_workspace(window);
+    ws = wnck_window_get_workspace(window);
     if(ws)
-        ws_num = netk_workspace_get_number(ws);
+        ws_num = wnck_workspace_get_number(ws);
     
-    if(   (changed_mask & NETK_WINDOW_STATE_MINIMIZED
-           && new_state & NETK_WINDOW_STATE_MINIMIZED)
-       || (changed_mask & NETK_WINDOW_STATE_SKIP_TASKLIST
-           && !(new_state & NETK_WINDOW_STATE_SKIP_TASKLIST)))
+    if(   (changed_mask & WNCK_WINDOW_STATE_MINIMIZED
+           && new_state & WNCK_WINDOW_STATE_MINIMIZED)
+       || (changed_mask & WNCK_WINDOW_STATE_SKIP_TASKLIST
+           && !(new_state & WNCK_WINDOW_STATE_SKIP_TASKLIST)))
     {
         is_add = TRUE;
     }
@@ -356,7 +358,7 @@
     /* this is a cute way of handling adding/removing from *all* workspaces
      * when we're dealing with a sticky windows, and just adding/removing
      * from a single workspace otherwise, without duplicating code */
-    if(netk_window_is_pinned(window)) {
+    if(wnck_window_is_pinned(window)) {
         i = 0;
         max_i = wmanager->priv->nworkspaces;
     } else {
@@ -402,24 +404,24 @@
 }
 
 static void
-window_workspace_changed_cb(NetkWindow *window,
+window_workspace_changed_cb(WnckWindow *window,
                             gpointer user_data)
 {
     XfdesktopWindowIconManager *wmanager = user_data;
-    NetkWorkspace *new_ws;
+    WnckWorkspace *new_ws;
     gint i, new_ws_num = -1, n_ws;
     XfdesktopIcon *icon;
     
     TRACE("entering");
     
-    if(!netk_window_is_minimized(window))
+    if(!wnck_window_is_minimized(window))
         return;
     
     n_ws = wmanager->priv->nworkspaces;
     
-    new_ws = netk_window_get_workspace(window);
+    new_ws = wnck_window_get_workspace(window);
     if(new_ws)
-        new_ws_num = netk_workspace_get_number(new_ws);
+        new_ws_num = wnck_workspace_get_number(new_ws);
     
     for(i = 0; i < n_ws; i++) {
         if(!wmanager->priv->icon_workspaces[i]->icons)
@@ -452,7 +454,7 @@
                     GObject *where_the_object_was)
 {
     XfdesktopWindowIconManager *wmanager = data;
-    NetkWindow *window = (NetkWindow *)where_the_object_was;
+    WnckWindow *window = (WnckWindow *)where_the_object_was;
     gint i;
     XfdesktopIcon *icon;
     
@@ -476,8 +478,8 @@
 }
 
 static void
-window_created_cb(NetkScreen *netk_screen,
-                  NetkWindow *window,
+window_created_cb(WnckScreen *wnck_screen,
+                  WnckWindow *window,
                   gpointer user_data)
 {
     XfdesktopWindowIconManager *wmanager = user_data;
@@ -538,20 +540,20 @@
                      
G_CALLBACK(xfdesktop_window_icon_manager_populate_context_menu),
                      wmanager);
     
-    netk_screen_force_update(wmanager->priv->netk_screen);
-    g_signal_connect(G_OBJECT(wmanager->priv->netk_screen),
+    wnck_screen_force_update(wmanager->priv->wnck_screen);
+    g_signal_connect(G_OBJECT(wmanager->priv->wnck_screen),
                      "active-workspace-changed",
                      G_CALLBACK(workspace_changed_cb), wmanager);
-    g_signal_connect(G_OBJECT(wmanager->priv->netk_screen), "window-opened",
+    g_signal_connect(G_OBJECT(wmanager->priv->wnck_screen), "window-opened",
                      G_CALLBACK(window_created_cb), wmanager);
-    g_signal_connect(G_OBJECT(wmanager->priv->netk_screen), 
"workspace-created",
+    g_signal_connect(G_OBJECT(wmanager->priv->wnck_screen), 
"workspace-created",
                      G_CALLBACK(workspace_created_cb), wmanager);
-    g_signal_connect(G_OBJECT(wmanager->priv->netk_screen),
+    g_signal_connect(G_OBJECT(wmanager->priv->wnck_screen),
                      "workspace-destroyed",
                      G_CALLBACK(workspace_destroyed_cb), wmanager);
     
-    wmanager->priv->nworkspaces = 
netk_screen_get_workspace_count(wmanager->priv->netk_screen);
-    wmanager->priv->active_ws_num = 
netk_workspace_get_number(netk_screen_get_active_workspace(wmanager->priv->netk_screen));
+    wmanager->priv->nworkspaces = 
wnck_screen_get_workspace_count(wmanager->priv->wnck_screen);
+    wmanager->priv->active_ws_num = 
wnck_workspace_get_number(wnck_screen_get_active_workspace(wmanager->priv->wnck_screen));
     wmanager->priv->icon_workspaces = g_malloc0(wmanager->priv->nworkspaces
                                                 * sizeof(gpointer));
     for(i = 0; i < wmanager->priv->nworkspaces; ++i) {
@@ -559,9 +561,9 @@
                                                     1);
     }
     
-    windows = netk_screen_get_windows(wmanager->priv->netk_screen);
+    windows = wnck_screen_get_windows(wmanager->priv->wnck_screen);
     for(l = windows; l; l = l->next) {
-        NetkWindow *window = l->data;
+        WnckWindow *window = l->data;
         
         g_signal_connect(G_OBJECT(window), "state-changed",
                          G_CALLBACK(window_state_changed_cb), wmanager);
@@ -570,7 +572,7 @@
         g_object_weak_ref(G_OBJECT(window), window_destroyed_cb, wmanager);
     }
     
-    workspace_changed_cb(wmanager->priv->netk_screen, wmanager);
+    workspace_changed_cb(wmanager->priv->wnck_screen, NULL, wmanager);
     
     wmanager->priv->inited = TRUE;
     
@@ -588,16 +590,16 @@
     
     wmanager->priv->inited = FALSE;
     
-    g_signal_handlers_disconnect_by_func(G_OBJECT(wmanager->priv->netk_screen),
+    g_signal_handlers_disconnect_by_func(G_OBJECT(wmanager->priv->wnck_screen),
                                          G_CALLBACK(workspace_changed_cb),
                                          wmanager);
-    g_signal_handlers_disconnect_by_func(G_OBJECT(wmanager->priv->netk_screen),
+    g_signal_handlers_disconnect_by_func(G_OBJECT(wmanager->priv->wnck_screen),
                                          G_CALLBACK(window_created_cb),
                                          wmanager);
-    g_signal_handlers_disconnect_by_func(G_OBJECT(wmanager->priv->netk_screen),
+    g_signal_handlers_disconnect_by_func(G_OBJECT(wmanager->priv->wnck_screen),
                                          G_CALLBACK(workspace_created_cb),
                                          wmanager);
-    g_signal_handlers_disconnect_by_func(G_OBJECT(wmanager->priv->netk_screen),
+    g_signal_handlers_disconnect_by_func(G_OBJECT(wmanager->priv->wnck_screen),
                                          G_CALLBACK(workspace_destroyed_cb),
                                          wmanager);
     
@@ -605,7 +607,7 @@
                                          
G_CALLBACK(xfdesktop_window_icon_manager_populate_context_menu),
                                          wmanager);
     
-    windows = netk_screen_get_windows(wmanager->priv->netk_screen);
+    windows = wnck_screen_get_windows(wmanager->priv->wnck_screen);
     for(l = windows; l; l = l->next) {
         g_signal_handlers_disconnect_by_func(G_OBJECT(l->data),
                                              
G_CALLBACK(window_state_changed_cb),

Modified: xfdesktop/trunk/src/xfdesktop-window-icon.c
===================================================================
--- xfdesktop/trunk/src/xfdesktop-window-icon.c 2008-04-23 21:24:33 UTC (rev 
26889)
+++ xfdesktop/trunk/src/xfdesktop-window-icon.c 2008-04-26 15:42:39 UTC (rev 
26890)
@@ -26,8 +26,9 @@
 #include <string.h>
 #endif
 
+#include <libwnck/libwnck.h>
+#include <libwnck/window-action-menu.h>
 #include <libxfcegui4/libxfcegui4.h>
-#include <libxfcegui4/netk-window-action-menu.h>
 
 #include "xfdesktop-window-icon.h"
 
@@ -37,7 +38,7 @@
     GdkPixbuf *pix;
     gint cur_pix_size;
     gchar *label;
-    NetkWindow *window;
+    WnckWindow *window;
 };
 
 static void xfdesktop_window_icon_class_init(XfdesktopWindowIconClass *klass);
@@ -52,9 +53,9 @@
 static gboolean xfdesktop_window_icon_populate_context_menu(XfdesktopIcon 
*icon,
                                                             GtkWidget *menu);
 
-static void xfdesktop_window_name_changed_cb(NetkWindow *window,
+static void xfdesktop_window_name_changed_cb(WnckWindow *window,
                                              gpointer user_data);
-static void xfdesktop_window_icon_changed_cb(NetkWindow *window,
+static void xfdesktop_window_icon_changed_cb(WnckWindow *window,
                                              gpointer user_data);
 
 
@@ -121,7 +122,7 @@
 
 
 static void
-xfdesktop_window_name_changed_cb(NetkWindow *window,
+xfdesktop_window_name_changed_cb(WnckWindow *window,
                                  gpointer user_data)
 {
     XfdesktopWindowIcon *icon = user_data;
@@ -133,7 +134,7 @@
 }
 
 static void
-xfdesktop_window_icon_changed_cb(NetkWindow *window,
+xfdesktop_window_icon_changed_cb(WnckWindow *window,
                                  gpointer user_data)
 {
     XfdesktopWindowIcon *icon = user_data;
@@ -160,7 +161,7 @@
         if(window_icon->priv->pix)
             g_object_unref(G_OBJECT(window_icon->priv->pix));
         
-        window_icon->priv->pix = 
netk_window_get_icon(window_icon->priv->window);
+        window_icon->priv->pix = 
wnck_window_get_icon(window_icon->priv->window);
         if(window_icon->priv->pix) {
             if(gdk_pixbuf_get_width(window_icon->priv->pix) != size) {
                 window_icon->priv->pix = 
gdk_pixbuf_scale_simple(window_icon->priv->pix,
@@ -182,7 +183,7 @@
     XfdesktopWindowIcon *window_icon = XFDESKTOP_WINDOW_ICON(icon);
     
     if(!window_icon->priv->label)
-        window_icon->priv->label = 
g_strdup(netk_window_get_name(window_icon->priv->window));
+        window_icon->priv->label = 
g_strdup(wnck_window_get_name(window_icon->priv->window));
     
     return window_icon->priv->label;
 }
@@ -192,7 +193,8 @@
 {
     XfdesktopWindowIcon *window_icon = XFDESKTOP_WINDOW_ICON(icon);
     
-    netk_window_activate(window_icon->priv->window);
+    wnck_window_activate(window_icon->priv->window,
+                         gtk_get_current_event_time());
     
     return TRUE;
 }
@@ -202,7 +204,7 @@
                                             GtkWidget *menu)
 {
     XfdesktopWindowIcon *window_icon = XFDESKTOP_WINDOW_ICON(icon);
-    GtkWidget *amenu = 
netk_create_window_action_menu(window_icon->priv->window);
+    GtkWidget *amenu = 
wnck_create_window_action_menu(window_icon->priv->window);
     GList *items, *l;
     
     /* this is unfortunately slightly retarded */
@@ -226,7 +228,7 @@
 
 
 XfdesktopWindowIcon *
-xfdesktop_window_icon_new(NetkWindow *window,
+xfdesktop_window_icon_new(WnckWindow *window,
                           gint workspace)
 {
     XfdesktopWindowIcon *icon = g_object_new(XFDESKTOP_TYPE_WINDOW_ICON, NULL);

Modified: xfdesktop/trunk/src/xfdesktop-window-icon.h
===================================================================
--- xfdesktop/trunk/src/xfdesktop-window-icon.h 2008-04-23 21:24:33 UTC (rev 
26889)
+++ xfdesktop/trunk/src/xfdesktop-window-icon.h 2008-04-26 15:42:39 UTC (rev 
26890)
@@ -51,7 +51,7 @@
 
 GType xfdesktop_window_icon_get_type() G_GNUC_CONST;
 
-XfdesktopWindowIcon *xfdesktop_window_icon_new(NetkWindow *window,
+XfdesktopWindowIcon *xfdesktop_window_icon_new(WnckWindow *window,
                                                gint workspace);
 
 gint xfdesktop_window_icon_get_workspace(XfdesktopWindowIcon *window_icon);

_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to