summaryrefslogtreecommitdiff
path: root/applets/wncklet/window-list.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2013-07-26 17:18:03 +0200
committerStefano Karapetsas <[email protected]>2013-07-26 17:18:03 +0200
commitc0f23a7a46776f731f695eb89bef3496150c6470 (patch)
tree01a9c953d5d321ba80d68e871f77bf483ec03efb /applets/wncklet/window-list.c
parente1f3e5a08411bf396291583ede7e4dab0dd7a092 (diff)
downloadmate-panel-c0f23a7a46776f731f695eb89bef3496150c6470.tar.bz2
mate-panel-c0f23a7a46776f731f695eb89bef3496150c6470.tar.xz
wncklet: Come back to libwnck
Diffstat (limited to 'applets/wncklet/window-list.c')
-rw-r--r--applets/wncklet/window-list.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/applets/wncklet/window-list.c b/applets/wncklet/window-list.c
index 8dc900f4..60b0b177 100644
--- a/applets/wncklet/window-list.c
+++ b/applets/wncklet/window-list.c
@@ -1,6 +1,6 @@
/* -*- mode: C; c-file-style: "linux" -*- */
/*
- * libmatewnck based tasklist applet.
+ * libwnck based tasklist applet.
* (C) 2001 Red Hat, Inc
* (C) 2001 Alexander Larsson
*
@@ -19,7 +19,7 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include <libmatewnck/libmatewnck.h>
+#include <libwnck/libwnck.h>
#include <gio/gio.h>
#include "wncklet.h"
@@ -33,7 +33,7 @@ typedef struct {
GtkWidget* tasklist;
gboolean include_all_workspaces;
- MatewnckTasklistGroupingType grouping;
+ WnckTasklistGroupingType grouping;
gboolean move_unminimized_windows;
GtkOrientation orientation;
@@ -71,9 +71,9 @@ static void tasklist_update(TasklistData* tasklist)
gtk_widget_set_size_request(GTK_WIDGET(tasklist->tasklist), tasklist->size, -1);
}
- matewnck_tasklist_set_grouping(MATEWNCK_TASKLIST(tasklist->tasklist), tasklist->grouping);
- matewnck_tasklist_set_include_all_workspaces(MATEWNCK_TASKLIST(tasklist->tasklist), tasklist->include_all_workspaces);
- matewnck_tasklist_set_switch_workspace_on_unminimize(MATEWNCK_TASKLIST(tasklist->tasklist), tasklist->move_unminimized_windows);
+ wnck_tasklist_set_grouping(WNCK_TASKLIST(tasklist->tasklist), tasklist->grouping);
+ wnck_tasklist_set_include_all_workspaces(WNCK_TASKLIST(tasklist->tasklist), tasklist->include_all_workspaces);
+ wnck_tasklist_set_switch_workspace_on_unminimize(WNCK_TASKLIST(tasklist->tasklist), tasklist->move_unminimized_windows);
}
static void response_cb(GtkWidget* widget, int id, TasklistData* tasklist)
@@ -115,7 +115,9 @@ static void applet_change_orient(MatePanelApplet* applet, MatePanelAppletOrient
tasklist->orientation = new_orient;
- matewnck_tasklist_set_orientation (tasklist->tasklist, new_orient);
+#if WNCK_CHECK_VERSION (3, 4, 6)
+ wnck_tasklist_set_orientation (tasklist->tasklist, new_orient);
+#endif
tasklist_update(tasklist);
}
@@ -124,11 +126,11 @@ static void applet_change_background(MatePanelApplet* applet, MatePanelAppletBac
switch (type)
{
case PANEL_NO_BACKGROUND:
- matewnck_tasklist_set_button_relief(MATEWNCK_TASKLIST(tasklist->tasklist), GTK_RELIEF_NORMAL);
+ wnck_tasklist_set_button_relief(WNCK_TASKLIST(tasklist->tasklist), GTK_RELIEF_NORMAL);
break;
case PANEL_COLOR_BACKGROUND:
case PANEL_PIXMAP_BACKGROUND:
- matewnck_tasklist_set_button_relief(MATEWNCK_TASKLIST(tasklist->tasklist), GTK_RELIEF_NONE);
+ wnck_tasklist_set_button_relief(WNCK_TASKLIST(tasklist->tasklist), GTK_RELIEF_NONE);
break;
}
}
@@ -231,18 +233,18 @@ static void display_all_workspaces_changed(GSettings* settings, gchar* key, Task
tasklist_properties_update_content_radio(tasklist);
}
-static GtkWidget* get_grouping_button(TasklistData* tasklist, MatewnckTasklistGroupingType type)
+static GtkWidget* get_grouping_button(TasklistData* tasklist, WnckTasklistGroupingType type)
{
switch (type)
{
default:
- case MATEWNCK_TASKLIST_NEVER_GROUP:
+ case WNCK_TASKLIST_NEVER_GROUP:
return tasklist->never_group_radio;
break;
- case MATEWNCK_TASKLIST_AUTO_GROUP:
+ case WNCK_TASKLIST_AUTO_GROUP:
return tasklist->auto_group_radio;
break;
- case MATEWNCK_TASKLIST_ALWAYS_GROUP:
+ case WNCK_TASKLIST_ALWAYS_GROUP:
return tasklist->always_group_radio;
break;
}
@@ -250,7 +252,7 @@ static GtkWidget* get_grouping_button(TasklistData* tasklist, MatewnckTasklistGr
static void group_windows_changed(GSettings* settings, gchar* key, TasklistData* tasklist)
{
- MatewnckTasklistGroupingType type;
+ WnckTasklistGroupingType type;
GtkWidget* button;
type = g_settings_get_enum (settings, key);
@@ -322,11 +324,11 @@ static void applet_size_request(GtkWidget* widget, GtkRequisition* requisition,
int len;
const int* size_hints;
GtkRequisition child_req;
- MatewnckTasklist* matewncktl = MATEWNCK_TASKLIST(tasklist->tasklist);
+ WnckTasklist* wncktl = WNCK_TASKLIST(tasklist->tasklist);
gtk_widget_get_child_requisition(tasklist->applet, &child_req);
- size_hints = matewnck_tasklist_get_size_hint_list(matewncktl, &len);
+ size_hints = wnck_tasklist_get_size_hint_list(wncktl, &len);
g_assert(len % 2 == 0);
mate_panel_applet_set_size_hints(MATE_PANEL_APPLET(tasklist->applet), size_hints, len, 0);
@@ -413,11 +415,13 @@ gboolean window_list_applet_fill(MatePanelApplet* applet)
break;
}
- tasklist->tasklist = matewnck_tasklist_new(NULL);
+ tasklist->tasklist = wnck_tasklist_new(NULL);
- matewnck_tasklist_set_orientation (tasklist->tasklist, tasklist->orientation);
+#if WNCK_CHECK_VERSION (3, 4, 6)
+ wnck_tasklist_set_orientation (tasklist->tasklist, tasklist->orientation);
+#endif
- matewnck_tasklist_set_icon_loader(MATEWNCK_TASKLIST(tasklist->tasklist), icon_loader_func, tasklist, NULL);
+ wnck_tasklist_set_icon_loader(WNCK_TASKLIST(tasklist->tasklist), icon_loader_func, tasklist, NULL);
g_signal_connect(G_OBJECT(tasklist->tasklist), "destroy", G_CALLBACK(destroy_tasklist), tasklist);