[Xfce4-commits] <xfdesktop:master> Depend on wnck >= 2.22, no longer use signal workarounds (bug #6638).
Jannis Pohlmann
noreply at xfce.org
Sun Nov 14 17:46:01 CET 2010
Updating branch refs/heads/master
to 6dbd07e89bf85d096595a823ba7fb6171f71f493 (commit)
from 4518463ef4d695a798c2c3f7ac57cafb3a0b23f0 (commit)
commit 6dbd07e89bf85d096595a823ba7fb6171f71f493
Author: Jannis Pohlmann <jannis at xfce.org>
Date: Sun Nov 14 17:43:48 2010 +0100
Depend on wnck >= 2.22, no longer use signal workarounds (bug #6638).
NEWS | 3 ++
configure.ac.in | 2 +-
src/xfdesktop-window-icon-manager.c | 36 +++++-----------------------------
3 files changed, 10 insertions(+), 31 deletions(-)
diff --git a/NEWS b/NEWS
index 70bdbd9..44a3c4a 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ Xfdesktop 4.7.x
items to the right-click menu.
* Select the correct icon style in the desktop settings on first
start (bug #6798).
+ * Depend on libwnck >= 2.22 so we no longer have to implement hacks
+ for the two different "active-workspace-changed" signal variants
+ in libwnck (bug #6638).
Xfdesktop 4.7.2
diff --git a/configure.ac.in b/configure.ac.in
index 96fba75..5832422 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -22,7 +22,7 @@ m4_define([garcon_minimum_version], [0.1.2])
m4_define([exo_minimum_version], [0.3.100])
m4_define([thunar_minimum_version], [1.1.3])
m4_define([dbus_minimum_version], [0.34])
-m4_define([wnck_minimum_version], [2.12])
+m4_define([wnck_minimum_version], [2.22])
m4_define([intltool_minimum_version], [0.31])
m4_define([xfconf_minimum_version], [4.6.0])
diff --git a/src/xfdesktop-window-icon-manager.c b/src/xfdesktop-window-icon-manager.c
index 491e307..f0c35ca 100644
--- a/src/xfdesktop-window-icon-manager.c
+++ b/src/xfdesktop-window-icon-manager.c
@@ -2,6 +2,7 @@
* xfdesktop - xfce4's desktop manager
*
* Copyright (c) 2006 Brian Tarricone, <bjt23 at cornell.edu>
+ * Copyright (c) 2010 Jannis Pohlmann, <jannis at xfce.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,18 +29,17 @@
#include <glib-object.h>
+#include <libwnck/libwnck.h>
+
#include <libxfce4util/libxfce4util.h>
+
#include <libxfce4ui/libxfce4ui.h>
-#include <libwnck/libwnck.h>
#include "xfdesktop-icon-view.h"
#include "xfdesktop-window-icon.h"
#include "xfdesktop-window-icon-manager.h"
#include "xfce-desktop.h"
-
-static gboolean __wnck_has_new_active_workspace_changed_signal = TRUE;
-
static void xfdesktop_window_icon_manager_set_property(GObject *object,
guint property_id,
const GValue *value,
@@ -93,7 +93,6 @@ static void
xfdesktop_window_icon_manager_class_init(XfdesktopWindowIconManagerClass *klass)
{
GObjectClass *gobject_class = (GObjectClass *)klass;
- guint sig_id;
g_type_class_add_private(klass, sizeof(XfdesktopWindowIconManagerPrivate));
@@ -107,21 +106,6 @@ xfdesktop_window_icon_manager_class_init(XfdesktopWindowIconManagerClass *klass)
GDK_TYPE_SCREEN,
G_PARAM_READWRITE
| G_PARAM_CONSTRUCT_ONLY));
-
- /* make sure the class is alive; g_signal_lookup() fails otherwise */
- if(!g_type_class_peek(WNCK_TYPE_SCREEN))
- g_type_class_ref(WNCK_TYPE_SCREEN);
- sig_id = g_signal_lookup("active-workspace-changed", WNCK_TYPE_SCREEN);
- if(sig_id) {
- GSignalQuery query;
-
- g_signal_query(sig_id, &query);
- if(query.n_params == 0)
- __wnck_has_new_active_workspace_changed_signal = FALSE;
- else
- __wnck_has_new_active_workspace_changed_signal = TRUE;
- DBG("active-workspace-changed signal has %d param(s)\n", query.n_params);
- }
}
static void
@@ -236,21 +220,13 @@ xfdesktop_add_window_icons_foreach(gpointer key,
static void
workspace_changed_cb(WnckScreen *wnck_screen,
- gpointer arg1,
+ WnckWorkspace *previously_active_space,
gpointer user_data)
{
- XfdesktopWindowIconManager *wmanager;
+ XfdesktopWindowIconManager *wmanager = XFDESKTOP_WINDOW_ICON_MANAGER(user_data);
gint n;
WnckWorkspace *ws;
- /* as of libwnck 2.20, the "active-workspace-changed" signal has
- * a new prototype with an extra argument. previous versions don't
- * have this argument, so we fudge this here (bug 4395). */
- if(G_LIKELY(__wnck_has_new_active_workspace_changed_signal))
- wmanager = XFDESKTOP_WINDOW_ICON_MANAGER(user_data);
- else
- wmanager = XFDESKTOP_WINDOW_ICON_MANAGER(arg1);
-
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");
More information about the Xfce4-commits
mailing list