diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | mate-window-picker-applet/Makefile.am | 7 | ||||
-rw-r--r-- | mate-window-picker-applet/applet.c | 9 | ||||
-rw-r--r-- | mate-window-picker-applet/task-item.c | 140 | ||||
-rw-r--r-- | mate-window-picker-applet/task-item.h | 5 | ||||
-rw-r--r-- | mate-window-picker-applet/task-list.c | 31 | ||||
-rw-r--r-- | mate-window-picker-applet/task-title.c | 95 | ||||
-rw-r--r-- | maximus/Makefile.am | 8 | ||||
-rw-r--r-- | maximus/maximus-app.c | 130 | ||||
-rw-r--r-- | maximus/maximus-app.h | 3 | ||||
-rw-r--r-- | maximus/maximus-bind.c | 71 | ||||
-rw-r--r-- | maximus/xutils.c | 13 | ||||
-rw-r--r-- | maximus/xutils.h | 12 |
14 files changed, 276 insertions, 257 deletions
diff --git a/Makefile.am b/Makefile.am index 0e846ca..228cd69 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,7 @@ SUBDIRS = po maximus mate-window-picker-applet +ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} + EXTRA_DIST = intltool-merge.in intltool-extract.in intltool-update.in DISTCLEANFILES = intltool-merge intltool-update intltool-extract diff --git a/configure.ac b/configure.ac index 6e86256..fa42dc2 100644 --- a/configure.ac +++ b/configure.ac @@ -1,8 +1,9 @@ AC_PREREQ(2.53) AC_INIT(mate-netbook, 1.6.0, []) -AM_INIT_AUTOMAKE() +AM_INIT_AUTOMAKE(tar-ustar no-dist-gzip dist-xz) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_CONFIG_SRCDIR(maximus/main.c) +AC_CONFIG_MACRO_DIR([m4]) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE @@ -34,7 +35,7 @@ AC_SUBST(GCC_FLAGS) PKG_CHECK_MODULES(MAXIMUS_DEPS, gtk+-2.0 gio-2.0 - libmatewnck + libwnck-1.0 xtst libfakekey unique-1.0 @@ -47,7 +48,7 @@ PKG_CHECK_MODULES(MATEWINDOWPICKER_DEPS, gtk+-2.0 glib-2.0 gio-2.0 - libmatewnck + libwnck-1.0 ) AC_SUBST(MATEWINDOWPICKER_DEPS_CFLAGS) AC_SUBST(MATEWINDOWPICKER_DEPS_LIBS) diff --git a/mate-window-picker-applet/Makefile.am b/mate-window-picker-applet/Makefile.am index c8df275..e577008 100644 --- a/mate-window-picker-applet/Makefile.am +++ b/mate-window-picker-applet/Makefile.am @@ -48,6 +48,8 @@ org.mate.panel.applet.MateWindowPickerFactory.service: $(service_in_files) @INTLTOOL_XML_NOMERGE_RULE@ gsettings_SCHEMAS = org.mate.panel.applet.mate-window-picker-applet.gschema.xml + +gsettings_SCHEMAS_in_in = $(gsettings_SCHEMAS:.xml=.xml.in.in) @GSETTINGS_RULES@ %.gschema.xml.in: %.gschema.xml.in.in Makefile @@ -57,11 +59,12 @@ xmluidir = $(datadir)/mate-panel/ui xmlui_DATA = mate-window-picker-applet-menu.xml EXTRA_DIST = \ - org.mate.panel.MateWindowPicker.panel-applet.in.in \ + org.mate.panel.MateWindowPicker.mate-panel-applet.in.in \ $(service_in_files) \ $(ui_DATA) \ $(convert_DATA) \ - $(gsettings_SCHEMAS_in_in) + $(gsettings_SCHEMAS_in_in) \ + $(xmlui_DATA) CLEANFILES = $(applet_DATA) $(applet_DATA).in $(service_DATA) $(gsettings_SCHEMAS_in) $(gsettings_SCHEMAS) diff --git a/mate-window-picker-applet/applet.c b/mate-window-picker-applet/applet.c index 5a7e646..be98536 100644 --- a/mate-window-picker-applet/applet.c +++ b/mate-window-picker-applet/applet.c @@ -28,7 +28,8 @@ #include <glib/gi18n.h> #include <gtk/gtk.h> -#include <libmatewnck/libmatewnck.h> +#define WNCK_I_KNOW_THIS_IS_UNSTABLE +#include <libwnck/libwnck.h> #include <gio/gio.h> #include <mate-panel-applet.h> @@ -138,7 +139,7 @@ cw_applet_fill (MatePanelApplet *applet, const gchar *iid, gpointer data) { - MatewnckScreen *screen; + WnckScreen *screen; WinPickerApp *app; GtkWidget *eb, *tasks, *title; gchar *ui_path; @@ -152,11 +153,11 @@ cw_applet_fill (MatePanelApplet *applet, bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); - matewnck_set_client_type (MATEWNCK_CLIENT_TYPE_PAGER); + wnck_set_client_type (WNCK_CLIENT_TYPE_PAGER); app = g_slice_new0 (WinPickerApp); mainapp = app; - screen = matewnck_screen_get_default (); + screen = wnck_screen_get_default (); /* prepare to disable Maximus */ object_class = G_OBJECT_GET_CLASS (G_OBJECT(applet)); diff --git a/mate-window-picker-applet/task-item.c b/mate-window-picker-applet/task-item.c index 3e0dd97..a584d23 100644 --- a/mate-window-picker-applet/task-item.c +++ b/mate-window-picker-applet/task-item.c @@ -35,8 +35,8 @@ G_DEFINE_TYPE (TaskItem, task_item, GTK_TYPE_EVENT_BOX); struct _TaskItemPrivate { - MatewnckWindow *window; - MatewnckScreen *screen; + WnckWindow *window; + WnckScreen *screen; GdkPixbuf *pixbuf; GdkRectangle area; @@ -66,13 +66,13 @@ update_hints (TaskItem *item) { GtkWidget *parent; GtkWidget *widget; - MatewnckWindow *window; + WnckWindow *window; gint x, y, x1, y1; widget = GTK_WIDGET (item); window = item->priv->window; /* Skip problems */ - if (!MATEWNCK_IS_WINDOW (window)) return; + if (!WNCK_IS_WINDOW (window)) return; if (!GTK_IS_WIDGET (widget)) return; /* Skip invisible windows */ @@ -99,7 +99,7 @@ update_hints (TaskItem *item) } /* Set the minimize hint for the window */ - matewnck_window_set_icon_geometry (window, x, y, + wnck_window_set_icon_geometry (window, x, y, widget->allocation.width, widget->allocation.height); } @@ -109,9 +109,9 @@ on_task_item_button_released (GtkWidget *widget, GdkEventButton *event, TaskItem *item) { - MatewnckWindow *window; - MatewnckScreen *screen; - MatewnckWorkspace *workspace; + WnckWindow *window; + WnckScreen *screen; + WnckWorkspace *workspace; TaskItemPrivate *priv; g_return_val_if_fail (TASK_IS_ITEM (item), TRUE); @@ -119,25 +119,25 @@ on_task_item_button_released (GtkWidget *widget, priv = item->priv; window = priv->window; - g_return_val_if_fail (MATEWNCK_IS_WINDOW (window), TRUE); + g_return_val_if_fail (WNCK_IS_WINDOW (window), TRUE); screen = priv->screen; - workspace = matewnck_window_get_workspace (window); + workspace = wnck_window_get_workspace (window); if (event->button == 1) { - if (MATEWNCK_IS_WORKSPACE (workspace) && workspace != matewnck_screen_get_active_workspace (screen)) + if (WNCK_IS_WORKSPACE (workspace) && workspace != wnck_screen_get_active_workspace (screen)) { - matewnck_workspace_activate (workspace, GDK_CURRENT_TIME); + wnck_workspace_activate (workspace, GDK_CURRENT_TIME); } - if (matewnck_window_is_active (window)) + if (wnck_window_is_active (window)) { - matewnck_window_minimize (window); + wnck_window_minimize (window); } else { - matewnck_window_activate (window, GDK_CURRENT_TIME); + wnck_window_activate (window, GDK_CURRENT_TIME); } } return TRUE; @@ -146,15 +146,15 @@ on_task_item_button_released (GtkWidget *widget, static void task_item_set_visibility (TaskItem *item) { - MatewnckScreen *screen; - MatewnckWindow *window; - MatewnckWorkspace *workspace; + WnckScreen *screen; + WnckWindow *window; + WnckWorkspace *workspace; g_return_if_fail (TASK_IS_ITEM (item)); TaskItemPrivate *priv = item->priv; - if (!MATEWNCK_IS_WINDOW (priv->window)) + if (!WNCK_IS_WINDOW (priv->window)) { gtk_widget_hide (GTK_WIDGET (item)); return; @@ -163,20 +163,20 @@ task_item_set_visibility (TaskItem *item) window = priv->window; screen = priv->screen; - workspace = matewnck_screen_get_active_workspace (screen); + workspace = wnck_screen_get_active_workspace (screen); gboolean show_all = task_list_get_show_all_windows (TASK_LIST (task_list_get_default ())); gboolean show_window = FALSE; - if (!matewnck_window_is_skip_tasklist (window)) + if (!wnck_window_is_skip_tasklist (window)) { - if (matewnck_workspace_is_virtual (workspace)) + if (wnck_workspace_is_virtual (workspace)) { - show_window = matewnck_window_is_in_viewport (window, workspace); + show_window = wnck_window_is_in_viewport (window, workspace); } else { - show_window = matewnck_window_is_on_workspace (window, workspace); + show_window = wnck_window_is_on_workspace (window, workspace); } show_window = show_window || show_all; } @@ -202,16 +202,16 @@ task_item_size_request (GtkWidget *widget, static GdkPixbuf * task_item_sized_pixbuf_for_window (TaskItem *item, - MatewnckWindow *window, + WnckWindow *window, gint size) { GdkPixbuf *pbuf = NULL; - g_return_val_if_fail (MATEWNCK_IS_WINDOW (window), NULL); + g_return_val_if_fail (WNCK_IS_WINDOW (window), NULL); - if (matewnck_window_has_icon_name (window)) + if (wnck_window_has_icon_name (window)) { - const gchar *icon_name = matewnck_window_get_icon_name (window); + const gchar *icon_name = wnck_window_get_icon_name (window); GtkIconTheme *icon_theme = gtk_icon_theme_get_default (); if (gtk_icon_theme_has_icon (icon_theme, icon_name)) @@ -228,7 +228,7 @@ task_item_sized_pixbuf_for_window (TaskItem *item, if (!pbuf) { - pbuf = gdk_pixbuf_copy (matewnck_window_get_icon (item->priv->window)); + pbuf = gdk_pixbuf_copy (wnck_window_get_icon (item->priv->window)); } gint width = gdk_pixbuf_get_width (pbuf); @@ -264,7 +264,7 @@ task_item_expose_event (GtkWidget *widget, item = TASK_ITEM (widget); priv = item->priv; - g_return_val_if_fail (MATEWNCK_IS_WINDOW (priv->window), FALSE); + g_return_val_if_fail (WNCK_IS_WINDOW (priv->window), FALSE); area = priv->area; cr = gdk_cairo_create (event->window); @@ -273,8 +273,8 @@ task_item_expose_event (GtkWidget *widget, desat = NULL; gint size = MIN (area.height, area.width); - gboolean active = matewnck_window_is_active (priv->window); - gboolean attention = matewnck_window_or_transient_needs_attention (priv->window); + gboolean active = wnck_window_is_active (priv->window); + gboolean attention = wnck_window_or_transient_needs_attention (priv->window); if (GDK_IS_PIXBUF (pbuf) && gdk_pixbuf_get_width (pbuf) != size && @@ -385,14 +385,14 @@ on_button_pressed (GtkWidget *button, GdkEventButton *event, TaskItem *item) { - MatewnckWindow *window; + WnckWindow *window; g_return_val_if_fail (TASK_IS_ITEM (item), FALSE); window = item->priv->window; - g_return_val_if_fail (MATEWNCK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE); if (event->button == 3) { - GtkWidget *menu = matewnck_action_menu_new (window); + GtkWidget *menu = wnck_action_menu_new (window); gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, event->button, event->time); return TRUE; @@ -408,11 +408,11 @@ on_query_tooltip (GtkWidget *widget, GtkTooltip *tooltip, TaskItem *item) { - MatewnckWindow *window = item->priv->window; - g_return_val_if_fail (MATEWNCK_IS_WINDOW (window), FALSE); + WnckWindow *window = item->priv->window; + g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE); - gtk_tooltip_set_text (tooltip, matewnck_window_get_name(window)); - gtk_tooltip_set_icon (tooltip, matewnck_window_get_icon (window)); + gtk_tooltip_set_text (tooltip, wnck_window_get_name(window)); + gtk_tooltip_set_icon (tooltip, wnck_window_get_icon (window)); return TRUE; } @@ -450,7 +450,7 @@ on_blink (TaskItem *item) gtk_widget_queue_draw (GTK_WIDGET (item)); - if (matewnck_window_or_transient_needs_attention (item->priv->window)) + if (wnck_window_or_transient_needs_attention (item->priv->window)) { return TRUE; } @@ -462,17 +462,17 @@ on_blink (TaskItem *item) } static void -on_window_state_changed (MatewnckWindow *window, - MatewnckWindowState changed_mask, - MatewnckWindowState new_state, +on_window_state_changed (WnckWindow *window, + WnckWindowState changed_mask, + WnckWindowState new_state, TaskItem *item) { - g_return_if_fail (MATEWNCK_IS_WINDOW (window)); + g_return_if_fail (WNCK_IS_WINDOW (window)); g_return_if_fail (TASK_IS_ITEM (item)); TaskItemPrivate *priv = item->priv; - if (new_state & MATEWNCK_WINDOW_STATE_URGENT && !priv->timer) + if (new_state & WNCK_WINDOW_STATE_URGENT && !priv->timer) { priv->timer = g_timeout_add (30, (GSourceFunc)on_blink, item); g_get_current_time (&priv->urgent_time); @@ -482,14 +482,14 @@ on_window_state_changed (MatewnckWindow *window, } static void -on_window_workspace_changed (MatewnckWindow *window, TaskItem *item) +on_window_workspace_changed (WnckWindow *window, TaskItem *item) { g_return_if_fail (TASK_IS_ITEM (item)); task_item_set_visibility (item); } -static void on_window_icon_changed (MatewnckWindow *window, TaskItem *item) +static void on_window_icon_changed (WnckWindow *window, TaskItem *item) { TaskItemPrivate *priv; @@ -507,11 +507,11 @@ static void on_window_icon_changed (MatewnckWindow *window, TaskItem *item) } static void -on_screen_active_window_changed (MatewnckScreen *screen, - MatewnckWindow *old_window, +on_screen_active_window_changed (WnckScreen *screen, + WnckWindow *old_window, TaskItem *item) { - MatewnckWindow *window; + WnckWindow *window; TaskItemPrivate *priv; g_return_if_fail (TASK_IS_ITEM (item)); @@ -519,10 +519,10 @@ on_screen_active_window_changed (MatewnckScreen *screen, priv = item->priv; window = priv->window; - g_return_if_fail (MATEWNCK_IS_WINDOW (window)); + g_return_if_fail (WNCK_IS_WINDOW (window)); - if ((MATEWNCK_IS_WINDOW (old_window) && window == old_window) || - window == matewnck_screen_get_active_window (screen)) + if ((WNCK_IS_WINDOW (old_window) && window == old_window) || + window == wnck_screen_get_active_window (screen)) { /* queue a draw to reflect that we are [no longer] the active window */ gtk_widget_queue_draw (GTK_WIDGET (item)); @@ -530,8 +530,8 @@ on_screen_active_window_changed (MatewnckScreen *screen, } static void -on_screen_active_workspace_changed (MatewnckScreen *screen, - MatewnckWorkspace *old_workspace, +on_screen_active_workspace_changed (WnckScreen *screen, + WnckWorkspace *old_workspace, TaskItem *item) { g_return_if_fail (TASK_IS_ITEM (item)); @@ -540,7 +540,7 @@ on_screen_active_workspace_changed (MatewnckScreen *screen, } static void -on_screen_active_viewport_changed (MatewnckScreen *screen, +on_screen_active_viewport_changed (WnckScreen *screen, TaskItem *item) { g_return_if_fail (TASK_IS_ITEM (item)); @@ -549,15 +549,15 @@ on_screen_active_viewport_changed (MatewnckScreen *screen, } static void -on_screen_window_closed (MatewnckScreen *screen, - MatewnckWindow *window, +on_screen_window_closed (WnckScreen *screen, + WnckWindow *window, TaskItem *item) { TaskItemPrivate *priv; g_return_if_fail (TASK_IS_ITEM (item)); priv = item->priv; - g_return_if_fail (MATEWNCK_IS_WINDOW (priv->window)); + g_return_if_fail (WNCK_IS_WINDOW (priv->window)); if (priv->window == window) { @@ -583,17 +583,17 @@ activate_window (GtkWidget *widget) priv = TASK_ITEM (widget)->priv; - g_return_val_if_fail (MATEWNCK_IS_WINDOW (priv->window), FALSE); + g_return_val_if_fail (WNCK_IS_WINDOW (priv->window), FALSE); active = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "drag-true")); if (active) { - MatewnckWindow *window; + WnckWindow *window; window = priv->window; - if (MATEWNCK_IS_WINDOW (window)) - matewnck_window_activate (window, time (NULL)); + if (WNCK_IS_WINDOW (window)) + wnck_window_activate (window, time (NULL)); } g_object_set_data (G_OBJECT (widget), "drag-true", GINT_TO_POINTER (0)); @@ -636,7 +636,7 @@ task_item_setup_atk (TaskItem *item) TaskItemPrivate *priv; GtkWidget *widget; AtkObject *atk; - MatewnckWindow *window; + WnckWindow *window; g_return_if_fail (TASK_IS_ITEM (item)); @@ -644,11 +644,11 @@ task_item_setup_atk (TaskItem *item) priv = item->priv; window = priv->window; - g_return_if_fail (MATEWNCK_IS_WINDOW (window)); + g_return_if_fail (WNCK_IS_WINDOW (window)); atk = gtk_widget_get_accessible (widget); atk_object_set_name (atk, _("Window Task Button")); - atk_object_set_description (atk, matewnck_window_get_name (window)); + atk_object_set_description (atk, wnck_window_get_name (window)); atk_object_set_role (atk, ATK_ROLE_PUSH_BUTTON); } @@ -703,14 +703,14 @@ task_item_init (TaskItem *item) } GtkWidget * -task_item_new (MatewnckWindow *window) +task_item_new (WnckWindow *window) { GtkWidget *item = NULL; TaskItem *task; TaskItemPrivate *priv; - MatewnckScreen *screen; + WnckScreen *screen; - g_return_val_if_fail (MATEWNCK_IS_WINDOW (window), item); + g_return_val_if_fail (WNCK_IS_WINDOW (window), item); item = g_object_new (TASK_TYPE_ITEM, "has-tooltip", TRUE, @@ -725,7 +725,7 @@ task_item_new (MatewnckWindow *window) priv = task->priv; priv->window = window; - screen = matewnck_window_get_screen (window); + screen = wnck_window_get_screen (window); priv->screen = screen; gtk_drag_dest_set (item, diff --git a/mate-window-picker-applet/task-item.h b/mate-window-picker-applet/task-item.h index bf6ce38..36623be 100644 --- a/mate-window-picker-applet/task-item.h +++ b/mate-window-picker-applet/task-item.h @@ -23,7 +23,8 @@ #include <glib.h> #include <gtk/gtk.h> -#include <libmatewnck/libmatewnck.h> +#define WNCK_I_KNOW_THIS_IS_UNSTABLE +#include <libwnck/libwnck.h> #define TASK_TYPE_ITEM (task_item_get_type ()) @@ -62,7 +63,7 @@ struct _TaskItemClass GType task_item_get_type (void) G_GNUC_CONST; -GtkWidget * task_item_new (MatewnckWindow *window); +GtkWidget * task_item_new (WnckWindow *window); GtkWidget * task_item_get_default (void); diff --git a/mate-window-picker-applet/task-list.c b/mate-window-picker-applet/task-list.c index 43c0d5d..2c3c635 100644 --- a/mate-window-picker-applet/task-list.c +++ b/mate-window-picker-applet/task-list.c @@ -20,7 +20,8 @@ #include "task-list.h" #include "task-item.h" -#include <libmatewnck/libmatewnck.h> +#define WNCK_I_KNOW_THIS_IS_UNSTABLE +#include <libwnck/libwnck.h> G_DEFINE_TYPE (TaskList, task_list, GTK_TYPE_HBOX); @@ -30,7 +31,7 @@ G_DEFINE_TYPE (TaskList, task_list, GTK_TYPE_HBOX); struct _TaskListPrivate { - MatewnckScreen *screen; + WnckScreen *screen; GHashTable *win_table; guint timer; guint counter; @@ -65,22 +66,22 @@ on_task_item_closed (TaskItem *item, } static void -on_window_opened (MatewnckScreen *screen, - MatewnckWindow *window, +on_window_opened (WnckScreen *screen, + WnckWindow *window, TaskList *list) { TaskListPrivate *priv; - MatewnckWindowType type; + WnckWindowType type; g_return_if_fail (TASK_IS_LIST (list)); priv = list->priv; - type = matewnck_window_get_window_type (window); + type = wnck_window_get_window_type (window); - if (type == MATEWNCK_WINDOW_DESKTOP - || type == MATEWNCK_WINDOW_DOCK - || type == MATEWNCK_WINDOW_SPLASHSCREEN - || type == MATEWNCK_WINDOW_MENU) + if (type == WNCK_WINDOW_DESKTOP + || type == WNCK_WINDOW_DOCK + || type == WNCK_WINDOW_SPLASHSCREEN + || type == WNCK_WINDOW_MENU) return; GtkWidget *item = task_item_new (window); @@ -175,10 +176,10 @@ static void task_list_init (TaskList *list) { TaskListPrivate *priv; - + priv = list->priv = TASK_LIST_GET_PRIVATE (list); - priv->screen = matewnck_screen_get_default (); + priv->screen = wnck_screen_get_default (); priv->win_table = g_hash_table_new (NULL, NULL); @@ -224,14 +225,14 @@ task_list_get_desktop_visible (TaskList *list) g_return_val_if_fail (TASK_IS_LIST (list), TRUE); - windows = matewnck_screen_get_windows (list->priv->screen); + windows = wnck_screen_get_windows (list->priv->screen); for (w = windows; w; w = w->next) { - MatewnckWindow *window; + WnckWindow *window; window = w->data; - if (MATEWNCK_IS_WINDOW (window) && !matewnck_window_is_minimized (window)) + if (WNCK_IS_WINDOW (window) && !wnck_window_is_minimized (window)) all_minimised = FALSE; } diff --git a/mate-window-picker-applet/task-title.c b/mate-window-picker-applet/task-title.c index 35d8854..5db675f 100644 --- a/mate-window-picker-applet/task-title.c +++ b/mate-window-picker-applet/task-title.c @@ -19,7 +19,8 @@ #include "task-title.h" -#include <libmatewnck/libmatewnck.h> +#define WNCK_I_KNOW_THIS_IS_UNSTABLE +#include <libwnck/libwnck.h> #include <mate-panel-applet.h> #include "task-list.h" @@ -35,8 +36,8 @@ G_DEFINE_TYPE (TaskTitle, task_title, GTK_TYPE_EVENT_BOX); struct _TaskTitlePrivate { - MatewnckScreen *screen; - MatewnckWindow *window; + WnckScreen *screen; + WnckWindow *window; GtkWidget *align; GtkWidget *box; GtkWidget *label; @@ -56,7 +57,7 @@ on_close_clicked (GtkButton *button, TaskTitle *title) { TaskTitlePrivate *priv; - MatewnckWindow *window; + WnckWindow *window; g_return_val_if_fail (TASK_IS_TITLE (title), FALSE); priv = title->priv; @@ -64,10 +65,10 @@ on_close_clicked (GtkButton *button, if (event->button != 1 || !priv->mouse_in_close_button) return FALSE; - window = matewnck_screen_get_active_window (priv->screen); + window = wnck_screen_get_active_window (priv->screen); - if (!MATEWNCK_IS_WINDOW (window) - || matewnck_window_get_window_type (window) == MATEWNCK_WINDOW_DESKTOP) + if (!WNCK_IS_WINDOW (window) + || wnck_window_get_window_type (window) == WNCK_WINDOW_DESKTOP) { gdk_spawn_command_line_on_screen (gdk_screen_get_default (), LOGOUT, NULL); @@ -76,7 +77,7 @@ on_close_clicked (GtkButton *button, { if (priv->window == window) disconnect_window (title); - matewnck_window_close (window, GDK_CURRENT_TIME); + wnck_window_close (window, GDK_CURRENT_TIME); } gtk_widget_queue_draw (GTK_WIDGET (title)); @@ -138,32 +139,32 @@ on_button_expose (GtkWidget *widget, } static void -on_name_changed (MatewnckWindow *window, TaskTitle *title) +on_name_changed (WnckWindow *window, TaskTitle *title) { TaskTitlePrivate *priv; g_return_if_fail (TASK_IS_TITLE (title)); - g_return_if_fail (MATEWNCK_IS_WINDOW (window)); + g_return_if_fail (WNCK_IS_WINDOW (window)); priv = title->priv; if (priv->window != window) return; gtk_label_set_text (GTK_LABEL (title->priv->label), - matewnck_window_get_name (window)); + wnck_window_get_name (window)); gtk_widget_set_tooltip_text (GTK_WIDGET (title), - matewnck_window_get_name (window)); + wnck_window_get_name (window)); gtk_widget_queue_draw (GTK_WIDGET (title)); } static void -on_icon_changed (MatewnckWindow *window, TaskTitle *title) +on_icon_changed (WnckWindow *window, TaskTitle *title) { TaskTitlePrivate *priv; g_return_if_fail (TASK_IS_TITLE (title)); - g_return_if_fail (MATEWNCK_IS_WINDOW (window)); + g_return_if_fail (WNCK_IS_WINDOW (window)); priv = title->priv; if (priv->window != window) @@ -173,21 +174,21 @@ on_icon_changed (MatewnckWindow *window, TaskTitle *title) } static void -on_state_changed (MatewnckWindow *window, - MatewnckWindowState changed_mask, - MatewnckWindowState new_state, +on_state_changed (WnckWindow *window, + WnckWindowState changed_mask, + WnckWindowState new_state, TaskTitle *title) { TaskTitlePrivate *priv; g_return_if_fail (TASK_IS_TITLE (title)); - g_return_if_fail (MATEWNCK_IS_WINDOW (window)); + g_return_if_fail (WNCK_IS_WINDOW (window)); priv = title->priv; if (priv->window != window) return; - if (matewnck_window_is_maximized (window)) + if (wnck_window_is_maximized (window)) { gtk_widget_set_state (GTK_WIDGET (title), GTK_STATE_ACTIVE); gtk_widget_show (priv->box); @@ -212,35 +213,35 @@ disconnect_window (TaskTitle *title) } static void -on_active_window_changed (MatewnckScreen *screen, - MatewnckWindow *old_window, +on_active_window_changed (WnckScreen *screen, + WnckWindow *old_window, TaskTitle *title) { TaskTitlePrivate *priv; - MatewnckWindow *act_window; - MatewnckWindowType type = MATEWNCK_WINDOW_NORMAL; + WnckWindow *act_window; + WnckWindowType type = WNCK_WINDOW_NORMAL; g_return_if_fail (TASK_IS_TITLE (title)); priv = title->priv; - act_window = matewnck_screen_get_active_window (screen); + act_window = wnck_screen_get_active_window (screen); if (act_window) - type = matewnck_window_get_window_type (act_window); + type = wnck_window_get_window_type (act_window); - if (MATEWNCK_IS_WINDOW (act_window) - && matewnck_window_is_skip_tasklist (act_window) - && type != MATEWNCK_WINDOW_DESKTOP) + if (WNCK_IS_WINDOW (act_window) + && wnck_window_is_skip_tasklist (act_window) + && type != WNCK_WINDOW_DESKTOP) return; - if (type == MATEWNCK_WINDOW_DOCK - || type == MATEWNCK_WINDOW_SPLASHSCREEN - || type == MATEWNCK_WINDOW_MENU) + if (type == WNCK_WINDOW_DOCK + || type == WNCK_WINDOW_SPLASHSCREEN + || type == WNCK_WINDOW_MENU) return; disconnect_window (title); - if (!MATEWNCK_IS_WINDOW (act_window) - || matewnck_window_get_window_type (act_window) == MATEWNCK_WINDOW_DESKTOP) + if (!WNCK_IS_WINDOW (act_window) + || wnck_window_get_window_type (act_window) == WNCK_WINDOW_DESKTOP) { if (priv->show_home_title) { @@ -264,12 +265,12 @@ on_active_window_changed (MatewnckScreen *screen, else { gtk_label_set_text (GTK_LABEL (priv->label), - matewnck_window_get_name (act_window)); + wnck_window_get_name (act_window)); gtk_image_set_from_stock (GTK_IMAGE (priv->button_image), GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU); gtk_widget_set_tooltip_text (GTK_WIDGET (title), - matewnck_window_get_name (act_window)); + wnck_window_get_name (act_window)); gtk_widget_set_tooltip_text (priv->button, _("Close window")); g_signal_connect (act_window, "name-changed", @@ -282,14 +283,14 @@ on_active_window_changed (MatewnckScreen *screen, priv->window = act_window; } - if (MATEWNCK_IS_WINDOW (act_window) - && !matewnck_window_is_maximized (act_window) - && (priv->show_home_title ? type != MATEWNCK_WINDOW_DESKTOP : 1)) + if (WNCK_IS_WINDOW (act_window) + && !wnck_window_is_maximized (act_window) + && (priv->show_home_title ? type != WNCK_WINDOW_DESKTOP : 1)) { gtk_widget_set_state (GTK_WIDGET (title), GTK_STATE_NORMAL); gtk_widget_hide (priv->box); } - else if (!MATEWNCK_IS_WINDOW (act_window)) + else if (!WNCK_IS_WINDOW (act_window)) { if (task_list_get_desktop_visible (TASK_LIST (task_list_get_default ())) && priv->show_home_title) @@ -322,21 +323,21 @@ static gboolean on_button_release (GtkWidget *title, GdkEventButton *event) { TaskTitlePrivate *priv; - MatewnckWindow *window; + WnckWindow *window; GtkWidget *menu; g_return_val_if_fail (TASK_IS_TITLE (title), FALSE); priv = TASK_TITLE_GET_PRIVATE (title); - window = matewnck_screen_get_active_window (priv->screen); + window = wnck_screen_get_active_window (priv->screen); - g_return_val_if_fail (MATEWNCK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE); if (event->button == 3) { - if (matewnck_window_get_window_type (window) != MATEWNCK_WINDOW_DESKTOP) + if (wnck_window_get_window_type (window) != WNCK_WINDOW_DESKTOP) { - menu = matewnck_action_menu_new (window); + menu = wnck_action_menu_new (window); gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, event->button, event->time); return TRUE; @@ -344,9 +345,9 @@ on_button_release (GtkWidget *title, GdkEventButton *event) } else if (event->button == 1) { - if (event->type == GDK_2BUTTON_PRESS && matewnck_window_is_maximized (window)) + if (event->type == GDK_2BUTTON_PRESS && wnck_window_is_maximized (window)) { - matewnck_window_unmaximize (window); + wnck_window_unmaximize (window); } } @@ -411,7 +412,7 @@ task_title_init (TaskTitle *title) priv = title->priv = TASK_TITLE_GET_PRIVATE (title); - priv->screen = matewnck_screen_get_default (); + priv->screen = wnck_screen_get_default (); priv->window = NULL; /* FIXME we can add an option for this in future */ diff --git a/maximus/Makefile.am b/maximus/Makefile.am index 884fb22..139c675 100644 --- a/maximus/Makefile.am +++ b/maximus/Makefile.am @@ -32,6 +32,8 @@ mate_maximus_SOURCES = \ @INTLTOOL_XML_NOMERGE_RULE@ gsettings_SCHEMAS = org.mate.maximus.gschema.xml + +gsettings_SCHEMAS_in_in = $(gsettings_SCHEMAS:.xml=.xml.in.in) @GSETTINGS_RULES@ %.gschema.xml.in: %.gschema.xml.in.in Makefile @@ -43,4 +45,8 @@ convert_DATA = mate-maximus.convert desktopdir=$(sysconfdir)/xdg/autostart dist_desktop_DATA=mate-maximus-autostart.desktop -EXTRA_DIST = $(schema_DATA) $(convert_DATA) +CLEANFILES = $(gsettings_SCHEMAS) \ + $(gsettings_SCHEMAS_in) + + +EXTRA_DIST = $(gsettings_SCHEMAS_in_in) $(convert_DATA) diff --git a/maximus/maximus-app.c b/maximus/maximus-app.c index 334cca5..ea303d9 100644 --- a/maximus/maximus-app.c +++ b/maximus/maximus-app.c @@ -71,7 +71,7 @@ static gchar *default_exclude_classes[] = struct _MaximusAppPrivate { MaximusBind *bind; - MatewnckScreen *screen; + WnckScreen *screen; GSettings *settings; gchar **exclude_class_list; @@ -95,7 +95,7 @@ typedef struct { #define _XA_MOTIF_WM_HINTS "_MOTIF_WM_HINTS" static gboolean -matewnck_window_is_decorated (MatewnckWindow *window) +wnck_window_is_decorated (WnckWindow *window) { GdkDisplay *display = gdk_display_get_default(); Atom hints_atom = None; @@ -107,13 +107,13 @@ matewnck_window_is_decorated (MatewnckWindow *window) gulong bytes_after; gboolean retval; - g_return_val_if_fail (MATEWNCK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE); hints_atom = gdk_x11_get_xatom_by_name_for_display (display, _XA_MOTIF_WM_HINTS); XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), - matewnck_window_get_xid (window), + wnck_window_get_xid (window), hints_atom, 0, sizeof (MotifWmHints)/sizeof (long), False, AnyPropertyType, &type, &format, &nitems, &bytes_after, &data); @@ -131,7 +131,7 @@ matewnck_window_is_decorated (MatewnckWindow *window) } static void -gdk_window_set_mwm_hints (MatewnckWindow *window, +gdk_window_set_mwm_hints (WnckWindow *window, MotifWmHints *new_hints) { GdkDisplay *display = gdk_display_get_default(); @@ -143,14 +143,14 @@ gdk_window_set_mwm_hints (MatewnckWindow *window, gulong nitems; gulong bytes_after; - g_return_if_fail (MATEWNCK_IS_WINDOW (window)); + g_return_if_fail (WNCK_IS_WINDOW (window)); g_return_if_fail (GDK_IS_DISPLAY (display)); hints_atom = gdk_x11_get_xatom_by_name_for_display (display, _XA_MOTIF_WM_HINTS); XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), - matewnck_window_get_xid (window), + wnck_window_get_xid (window), hints_atom, 0, sizeof (MotifWmHints)/sizeof (long), False, AnyPropertyType, &type, &format, &nitems, &bytes_after, &data); @@ -173,25 +173,25 @@ gdk_window_set_mwm_hints (MatewnckWindow *window, } } - _matewnck_error_trap_push (); + _wnck_error_trap_push (); XChangeProperty (GDK_DISPLAY_XDISPLAY (display), - matewnck_window_get_xid (window), + wnck_window_get_xid (window), hints_atom, hints_atom, 32, PropModeReplace, (guchar *)hints, sizeof (MotifWmHints)/sizeof (long)); gdk_flush (); - _matewnck_error_trap_pop (); + _wnck_error_trap_pop (); if (data) XFree (data); } static void -_window_set_decorations (MatewnckWindow *window, +_window_set_decorations (WnckWindow *window, GdkWMDecoration decorations) { MotifWmHints *hints; - g_return_if_fail (MATEWNCK_IS_WINDOW (window)); + g_return_if_fail (WNCK_IS_WINDOW (window)); /* initialize to zero to avoid writing uninitialized data to socket */ hints = g_slice_new0 (MotifWmHints); @@ -206,17 +206,17 @@ _window_set_decorations (MatewnckWindow *window, /* </TAKEN FROM GDK> */ gboolean -window_is_too_large_for_screen (MatewnckWindow *window) +window_is_too_large_for_screen (WnckWindow *window) { static GdkScreen *screen = NULL; gint x=0, y=0, w=0, h=0; - g_return_val_if_fail (MATEWNCK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE); if (screen == NULL) screen = gdk_screen_get_default (); - matewnck_window_get_geometry (window, &x, &y, &w, &h); + wnck_window_get_geometry (window, &x, &y, &w, &h); /* some wiggle room */ return (screen && @@ -225,14 +225,14 @@ window_is_too_large_for_screen (MatewnckWindow *window) } static gboolean -on_window_maximised_changed (MatewnckWindow *window) +on_window_maximised_changed (WnckWindow *window) { - g_return_val_if_fail (MATEWNCK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE); if (window_is_too_large_for_screen (window)) { _window_set_decorations (window, 1); - matewnck_window_unmaximize (window); + wnck_window_unmaximize (window); } else { @@ -242,29 +242,29 @@ on_window_maximised_changed (MatewnckWindow *window) } static gboolean -enable_window_decorations (MatewnckWindow *window) +enable_window_decorations (WnckWindow *window) { - g_return_val_if_fail (MATEWNCK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE); _window_set_decorations (window, 1); return FALSE; } static void -on_window_state_changed (MatewnckWindow *window, - MatewnckWindowState change_mask, - MatewnckWindowState new_state, +on_window_state_changed (WnckWindow *window, + WnckWindowState change_mask, + WnckWindowState new_state, MaximusApp *app) { - g_return_if_fail (MATEWNCK_IS_WINDOW (window)); + g_return_if_fail (WNCK_IS_WINDOW (window)); if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window), "exclude"))==1) return; - if (change_mask & MATEWNCK_WINDOW_STATE_MAXIMIZED_HORIZONTALLY - || change_mask & MATEWNCK_WINDOW_STATE_MAXIMIZED_VERTICALLY) + if (change_mask & WNCK_WINDOW_STATE_MAXIMIZED_HORIZONTALLY + || change_mask & WNCK_WINDOW_STATE_MAXIMIZED_VERTICALLY) { - if (matewnck_window_is_maximized (window) && app->priv->undecorate) + if (wnck_window_is_maximized (window) && app->priv->undecorate) { g_idle_add ((GSourceFunc)on_window_maximised_changed, window); } @@ -276,44 +276,44 @@ on_window_state_changed (MatewnckWindow *window, } static gboolean -is_excluded (MaximusApp *app, MatewnckWindow *window) +is_excluded (MaximusApp *app, WnckWindow *window) { MaximusAppPrivate *priv; - MatewnckWindowType type; - MatewnckWindowActions actions; + WnckWindowType type; + WnckWindowActions actions; gchar *res_name; gchar *class_name; gint i; g_return_val_if_fail (MAXIMUS_IS_APP (app), TRUE); - g_return_val_if_fail (MATEWNCK_IS_WINDOW (window), TRUE); + g_return_val_if_fail (WNCK_IS_WINDOW (window), TRUE); priv = app->priv; - type = matewnck_window_get_window_type (window); - if (type != MATEWNCK_WINDOW_NORMAL) + type = wnck_window_get_window_type (window); + if (type != WNCK_WINDOW_NORMAL) return TRUE; if (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (window), "exclude"))==1) return TRUE; /* Ignore if the window is already fullscreen */ - if (matewnck_window_is_fullscreen (window)) + if (wnck_window_is_fullscreen (window)) { - g_debug ("Excluding (is fullscreen): %s\n",matewnck_window_get_name (window)); + g_debug ("Excluding (is fullscreen): %s\n",wnck_window_get_name (window)); return TRUE; } /* Make sure the window supports maximising */ - actions = matewnck_window_get_actions (window); - if (actions & MATEWNCK_WINDOW_ACTION_RESIZE - && actions & MATEWNCK_WINDOW_ACTION_MAXIMIZE_HORIZONTALLY - && actions & MATEWNCK_WINDOW_ACTION_MAXIMIZE_VERTICALLY - && actions & MATEWNCK_WINDOW_ACTION_MAXIMIZE) + actions = wnck_window_get_actions (window); + if (actions & WNCK_WINDOW_ACTION_RESIZE + && actions & WNCK_WINDOW_ACTION_MAXIMIZE_HORIZONTALLY + && actions & WNCK_WINDOW_ACTION_MAXIMIZE_VERTICALLY + && actions & WNCK_WINDOW_ACTION_MAXIMIZE) ; /* Is good to maximise */ else return TRUE; - _matewnck_get_wmclass (matewnck_window_get_xid (window), &res_name, &class_name); + _wnck_get_wmclass (wnck_window_get_xid (window), &res_name, &class_name); g_debug ("Window opened: res_name=%s -- class_name=%s", res_name, class_name); @@ -325,7 +325,7 @@ is_excluded (MaximusApp *app, MatewnckWindow *window) || (res_name && default_exclude_classes[i] && strstr (res_name, default_exclude_classes[i]))) { - g_debug ("Excluding: %s\n", matewnck_window_get_name (window)); + g_debug ("Excluding: %s\n", wnck_window_get_name (window)); return TRUE; } } @@ -336,7 +336,7 @@ is_excluded (MaximusApp *app, MatewnckWindow *window) if ((class_name && strstr (class_name, priv->exclude_class_list[i])) || (res_name && strstr (res_name, priv->exclude_class_list[i]) )) { - g_debug ("Excluding: %s\n", matewnck_window_get_name (window)); + g_debug ("Excluding: %s\n", wnck_window_get_name (window)); return TRUE; } } @@ -349,25 +349,25 @@ is_excluded (MaximusApp *app, MatewnckWindow *window) extern gboolean no_maximize; static void -on_window_opened (MatewnckScreen *screen, - MatewnckWindow *window, +on_window_opened (WnckScreen *screen, + WnckWindow *window, MaximusApp *app) { MaximusAppPrivate *priv; - MatewnckWindowType type; + WnckWindowType type; gint exclude = 0; g_return_if_fail (MAXIMUS_IS_APP (app)); - g_return_if_fail (MATEWNCK_IS_WINDOW (window)); + g_return_if_fail (WNCK_IS_WINDOW (window)); priv = app->priv; - type = matewnck_window_get_window_type (window); - if (type != MATEWNCK_WINDOW_NORMAL) + type = wnck_window_get_window_type (window); + if (type != WNCK_WINDOW_NORMAL) return; /* Ignore undecorated windows */ - exclude = matewnck_window_is_decorated (window) ? 0 : 1; - if (matewnck_window_is_maximized (window)) + exclude = wnck_window_is_decorated (window) ? 0 : 1; + if (wnck_window_is_maximized (window)) exclude = 0; g_object_set_data (G_OBJECT (window), "exclude", GINT_TO_POINTER (exclude)); @@ -380,7 +380,7 @@ on_window_opened (MatewnckScreen *screen, if (no_maximize || priv->no_maximize) { - if (matewnck_window_is_maximized(window)) + if (wnck_window_is_maximized(window)) { _window_set_decorations (window, 0); gdk_flush (); @@ -400,7 +400,7 @@ on_window_opened (MatewnckScreen *screen, } } - matewnck_window_maximize (window); + wnck_window_maximize (window); g_signal_connect (window, "state-changed", G_CALLBACK (on_window_state_changed), app); @@ -437,11 +437,11 @@ on_exclude_class_changed (GSettings *settings, } static gboolean -show_desktop (MatewnckScreen *screen) +show_desktop (WnckScreen *screen) { - g_return_val_if_fail (MATEWNCK_IS_SCREEN (screen), FALSE); + g_return_val_if_fail (WNCK_IS_SCREEN (screen), FALSE); - matewnck_screen_toggle_showing_desktop (screen, TRUE); + wnck_screen_toggle_showing_desktop (screen, TRUE); return FALSE; } @@ -455,22 +455,22 @@ on_app_undecorate_changed (GSettings *settings, g_return_if_fail (MAXIMUS_IS_APP (app)); priv = app->priv; - g_return_if_fail (MATEWNCK_IS_SCREEN (priv->screen)); + g_return_if_fail (WNCK_IS_SCREEN (priv->screen)); priv->undecorate = g_settings_get_boolean (settings, APP_UNDECORATE); g_debug ("%s\n", priv->undecorate ? "Undecorating" : "Decorating"); - windows = matewnck_screen_get_windows (priv->screen); + windows = wnck_screen_get_windows (priv->screen); for (w = windows; w; w = w->next) { - MatewnckWindow *window = w->data; + WnckWindow *window = w->data; - if (!MATEWNCK_IS_WINDOW (window)) + if (!WNCK_IS_WINDOW (window)) continue; if (no_maximize || priv->no_maximize) { - if (!matewnck_window_is_maximized(window)) + if (!wnck_window_is_maximized(window)) continue; } @@ -478,8 +478,8 @@ on_app_undecorate_changed (GSettings *settings, { gdk_error_trap_push (); _window_set_decorations (window, priv->undecorate ? 0 : 1); - matewnck_window_unmaximize (window); - matewnck_window_maximize (window); + wnck_window_unmaximize (window); + wnck_window_maximize (window); gdk_flush (); gdk_error_trap_pop (); @@ -504,7 +504,7 @@ static void maximus_app_init (MaximusApp *app) { MaximusAppPrivate *priv; - MatewnckScreen *screen; + WnckScreen *screen; priv = app->priv = MAXIMUS_APP_GET_PRIVATE (app); @@ -523,7 +523,7 @@ maximus_app_init (MaximusApp *app) G_CALLBACK (on_app_undecorate_changed), app); - priv->screen = screen = matewnck_screen_get_default (); + priv->screen = screen = wnck_screen_get_default (); g_signal_connect (screen, "window-opened", G_CALLBACK (on_window_opened), app); diff --git a/maximus/maximus-app.h b/maximus/maximus-app.h index 8eb64f7..715ab0a 100644 --- a/maximus/maximus-app.h +++ b/maximus/maximus-app.h @@ -22,7 +22,8 @@ #include <glib-object.h> #include <gtk/gtk.h> -#include <libmatewnck/libmatewnck.h> +#define WNCK_I_KNOW_THIS_IS_UNSTABLE +#include <libwnck/libwnck.h> #define MAXIMUS_TYPE_APP (maximus_app_get_type ()) diff --git a/maximus/maximus-bind.c b/maximus/maximus-bind.c index b58cbc1..7fbcefc 100644 --- a/maximus/maximus-bind.c +++ b/maximus/maximus-bind.c @@ -27,7 +27,8 @@ #include <gio/gio.h> -#include <libmatewnck/libmatewnck.h> +#define WNCK_I_KNOW_THIS_IS_UNSTABLE +#include <libwnck/libwnck.h> #include <X11/Xlib.h> #include <X11/Xresource.h> @@ -67,7 +68,7 @@ G_DEFINE_TYPE (MaximusBind, maximus_bind, G_TYPE_OBJECT); struct _MaximusBindPrivate { FakeKey *fk; - MatewnckScreen *screen; + WnckScreen *screen; GSettings *settings; gchar *binding; @@ -83,16 +84,16 @@ typedef struct } MaximusRule; static const gchar * -get_fullscreen_keystroke (GList *rules, MatewnckWindow *window) +get_fullscreen_keystroke (GList *rules, WnckWindow *window) { - MatewnckClassGroup *group; + WnckClassGroup *group; const gchar *class_name; GList *r; - group = matewnck_window_get_class_group (window); - class_name = matewnck_class_group_get_name (group); + group = wnck_window_get_class_group (window); + class_name = wnck_class_group_get_name (group); - g_debug ("Searching rules for %s:\n", matewnck_window_get_name (window)); + g_debug ("Searching rules for %s:\n", wnck_window_get_name (window)); for (r = rules; r; r = r->next) { @@ -112,14 +113,14 @@ get_fullscreen_keystroke (GList *rules, MatewnckWindow *window) } static const gchar * -get_unfullscreen_keystroke (GList *rules, MatewnckWindow *window) +get_unfullscreen_keystroke (GList *rules, WnckWindow *window) { - MatewnckClassGroup *group; + WnckClassGroup *group; const gchar *class_name; GList *r; - group = matewnck_window_get_class_group (window); - class_name = matewnck_class_group_get_name (group); + group = wnck_window_get_class_group (window); + class_name = wnck_class_group_get_name (group); for (r = rules; r; r = r->next) { @@ -138,16 +139,16 @@ real_fullscreen (MaximusBind *bind) { MaximusBindPrivate *priv; GdkDisplay UNUSED_VARIABLE *display; - MatewnckWindow *active; + WnckWindow *active; const gchar *keystroke; priv = bind->priv; display = gdk_display_get_default (); - active = matewnck_screen_get_active_window (priv->screen); + active = wnck_screen_get_active_window (priv->screen); - if (!MATEWNCK_IS_WINDOW (active) - || matewnck_window_get_window_type (active) != MATEWNCK_WINDOW_NORMAL) + if (!WNCK_IS_WINDOW (active) + || wnck_window_get_window_type (active) != WNCK_WINDOW_NORMAL) return FALSE; keystroke = get_fullscreen_keystroke (priv->rules, active); @@ -179,7 +180,7 @@ real_fullscreen (MaximusBind *bind) } } - if (!matewnck_window_is_fullscreen (active)) + if (!wnck_window_is_fullscreen (active)) { g_debug ("Sending fullscreen F11 event"); fakekey_press_keysym (priv->fk, XK_F11, 0); @@ -188,17 +189,17 @@ real_fullscreen (MaximusBind *bind) sleep (STATE_CHANGED_SLEEP); - if (!matewnck_window_is_fullscreen (active)) + if (!wnck_window_is_fullscreen (active)) { - g_debug ("Forcing fullscreen matewnck event"); - matewnck_window_set_fullscreen (active, TRUE); + g_debug ("Forcing fullscreen wnck event"); + wnck_window_set_fullscreen (active, TRUE); } return FALSE; } static void -fullscreen (MaximusBind *bind, MatewnckWindow *window) +fullscreen (MaximusBind *bind, WnckWindow *window) { MaximusBindPrivate UNUSED_VARIABLE *priv; @@ -212,16 +213,16 @@ real_unfullscreen (MaximusBind *bind) { MaximusBindPrivate *priv; GdkDisplay UNUSED_VARIABLE *display; - MatewnckWindow *active; + WnckWindow *active; const gchar *keystroke; priv = bind->priv; display = gdk_display_get_default (); - active = matewnck_screen_get_active_window (priv->screen); + active = wnck_screen_get_active_window (priv->screen); - if (!MATEWNCK_IS_WINDOW (active) - || matewnck_window_get_window_type (active) != MATEWNCK_WINDOW_NORMAL) + if (!WNCK_IS_WINDOW (active) + || wnck_window_get_window_type (active) != WNCK_WINDOW_NORMAL) return FALSE; keystroke = get_unfullscreen_keystroke (priv->rules, active); @@ -252,7 +253,7 @@ real_unfullscreen (MaximusBind *bind) return FALSE; } } - if (matewnck_window_is_fullscreen (active)) + if (wnck_window_is_fullscreen (active)) { g_debug ("Sending un-fullscreen F11 event"); fakekey_press_keysym (priv->fk, XK_F11, 0); @@ -261,17 +262,17 @@ real_unfullscreen (MaximusBind *bind) sleep (STATE_CHANGED_SLEEP); - if (matewnck_window_is_fullscreen (active)) + if (wnck_window_is_fullscreen (active)) { - g_debug ("Forcing un-fullscreen matewnck event"); - matewnck_window_set_fullscreen (active, FALSE); + g_debug ("Forcing un-fullscreen wnck event"); + wnck_window_set_fullscreen (active, FALSE); } return FALSE; } static void -unfullscreen (MaximusBind *bind, MatewnckWindow *window) +unfullscreen (MaximusBind *bind, WnckWindow *window) { MaximusBindPrivate UNUSED_VARIABLE *priv; @@ -285,17 +286,17 @@ static void on_binding_activated (gchar *keystring, MaximusBind *bind) { MaximusBindPrivate *priv; - MatewnckWindow *active; + WnckWindow *active; g_return_if_fail (MAXIMUS_IS_BIND (bind)); priv = bind->priv; - active = matewnck_screen_get_active_window (priv->screen); + active = wnck_screen_get_active_window (priv->screen); - if (matewnck_window_get_window_type (active) != MATEWNCK_WINDOW_NORMAL) + if (wnck_window_get_window_type (active) != WNCK_WINDOW_NORMAL) return; - if (matewnck_window_is_fullscreen (active)) + if (wnck_window_is_fullscreen (active)) { unfullscreen (bind, active); } @@ -462,12 +463,12 @@ maximus_bind_init (MaximusBind *bind) { MaximusBindPrivate *priv; GdkDisplay *display = gdk_display_get_default (); - MatewnckScreen *screen; + WnckScreen *screen; priv = bind->priv = MAXIMUS_BIND_GET_PRIVATE (bind); priv->fk = fakekey_init (GDK_DISPLAY_XDISPLAY (display)); - priv->screen = screen = matewnck_screen_get_default (); + priv->screen = screen = wnck_screen_get_default (); priv->rules = NULL; priv->settings = g_settings_new (BIND_SCHEMA); diff --git a/maximus/xutils.c b/maximus/xutils.c index 4e79569..3ff03bb 100644 --- a/maximus/xutils.c +++ b/maximus/xutils.c @@ -25,7 +25,8 @@ #include "xutils.h" #include <string.h> #include <stdio.h> -#include <libmatewnck/libmatewnck.h> +#define WNCK_I_KNOW_THIS_IS_UNSTABLE +#include <libwnck/libwnck.h> #ifdef __GNUC__ #define UNUSED_VARIABLE __attribute__ ((unused)) @@ -34,13 +35,13 @@ #endif void -_matewnck_error_trap_push (void) +_wnck_error_trap_push (void) { gdk_error_trap_push (); } int -_matewnck_error_trap_pop (void) +_wnck_error_trap_pop (void) { XSync (gdk_display, False); return gdk_error_trap_pop (); @@ -65,14 +66,14 @@ latin1_to_utf8 (const char *latin1) } void -_matewnck_get_wmclass (Window xwindow, +_wnck_get_wmclass (Window xwindow, char **res_class, char **res_name) { XClassHint ch; char UNUSED_VARIABLE *retval; - _matewnck_error_trap_push (); + _wnck_error_trap_push (); ch.res_name = NULL; ch.res_class = NULL; @@ -80,7 +81,7 @@ _matewnck_get_wmclass (Window xwindow, XGetClassHint (gdk_display, xwindow, &ch); - _matewnck_error_trap_pop (); + _wnck_error_trap_pop (); retval = NULL; diff --git a/maximus/xutils.h b/maximus/xutils.h index 58e1d6e..82e36c8 100644 --- a/maximus/xutils.h +++ b/maximus/xutils.h @@ -21,8 +21,8 @@ * Boston, MA 02111-1307, USA. */ -#ifndef MATEWNCK_XUTILS_H -#define MATEWNCK_XUTILS_H +#ifndef WNCK_XUTILS_H +#define WNCK_XUTILS_H #include <glib.h> #include <X11/Xlib.h> @@ -33,17 +33,17 @@ G_BEGIN_DECLS void -_matewnck_error_trap_push (void); +_wnck_error_trap_push (void); int -_matewnck_error_trap_pop (void); +_wnck_error_trap_pop (void); void -_matewnck_get_wmclass (Window xwindow, +_wnck_get_wmclass (Window xwindow, char **res_class, char **res_name); G_END_DECLS -#endif /* MATEWNCK_XUTILS_H */ +#endif /* WNCK_XUTILS_H */ |