From a40a9eccf41afe2d5e3464a928fb6502dacc0fde Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sun, 26 May 2002 15:54:38 +0000 Subject: [PATCH] Patch from Gaute Lindkvist so you can't move the panel or desktop to only 2002-05-26 Havoc Pennington Patch from Gaute Lindkvist so you can't move the panel or desktop to only one workspace. * src/keybindings.c (handle_move_to_workspace): don't allow moving window to another space if the window is always_sticky * src/window.c (recalc_window_features): set the always_sticky field for desktop/dock windows. (meta_window_show_menu): disable unsticking always sticky windows via the menus * src/menu.c (meta_window_menu_new): disable workspace items if requested --- ChangeLog | 16 ++++++++++++++++ src/keybindings.c | 3 +++ src/menu.c | 3 ++- src/window.c | 11 ++++++++++- src/window.h | 1 + 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5ba344fa3..bb76a6029 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2002-05-26 Havoc Pennington + + Patch from Gaute Lindkvist so you can't move the panel or desktop + to only one workspace. + + * src/keybindings.c (handle_move_to_workspace): don't allow moving + window to another space if the window is always_sticky + + * src/window.c (recalc_window_features): set the always_sticky + field for desktop/dock windows. + (meta_window_show_menu): disable unsticking always sticky windows + via the menus + + * src/menu.c (meta_window_menu_new): disable workspace items + if requested + 2002-05-26 Matthias Warkus * po/de.po: Added. diff --git a/src/keybindings.c b/src/keybindings.c index 65d841514..238a942dd 100644 --- a/src/keybindings.c +++ b/src/keybindings.c @@ -1662,6 +1662,9 @@ handle_move_to_workspace (MetaDisplay *display, which = GPOINTER_TO_INT (binding->handler->data); + if (window == NULL || window->always_sticky) + return; + workspace = NULL; if (which < 0) { diff --git a/src/menu.c b/src/menu.c index 7af1c11c6..92a850206 100644 --- a/src/menu.c +++ b/src/menu.c @@ -312,7 +312,8 @@ meta_window_menu_new (MetaFrames *frames, (active_workspace == i || insensitive & META_MENU_OP_WORKSPACES)) gtk_widget_set_sensitive (mi, FALSE); - + else if (insensitive & META_MENU_OP_WORKSPACES) + gtk_widget_set_sensitive (mi, FALSE); md = g_new (MenuData, 1); md->menu = menu; diff --git a/src/window.c b/src/window.c index c7843486f..9de610467 100644 --- a/src/window.c +++ b/src/window.c @@ -2718,7 +2718,7 @@ meta_window_focus (MetaWindow *window, void meta_window_change_workspace (MetaWindow *window, MetaWorkspace *workspace) -{ +{ meta_verbose ("Changing window %s to workspace %d\n", window->desc, meta_workspace_index (workspace)); @@ -4844,10 +4844,16 @@ recalc_window_features (MetaWindow *window) window->has_shade_func = TRUE; window->has_fullscreen_func = TRUE; + + window->always_sticky = FALSE; /* Semantic category overrides the MWM hints */ if (window->type == META_WINDOW_TOOLBAR) window->decorated = FALSE; + + if (window->type == META_WINDOW_DESKTOP || + window->type == META_WINDOW_DOCK) + window->always_sticky = TRUE; if (window->type == META_WINDOW_DESKTOP || window->type == META_WINDOW_DOCK || @@ -5360,6 +5366,9 @@ meta_window_show_menu (MetaWindow *window, if (!window->has_resize_func) insensitive |= META_MENU_OP_RESIZE; + + if (window->always_sticky) + insensitive |= META_MENU_OP_UNSTICK | META_MENU_OP_WORKSPACES; menu = meta_ui_window_menu_new (window->screen->ui, diff --git a/src/window.h b/src/window.h index 2c886c82f..7cbafd174 100644 --- a/src/window.h +++ b/src/window.h @@ -139,6 +139,7 @@ struct _MetaWindow /* Computed features of window */ guint decorated : 1; + guint always_sticky : 1; guint has_close_func : 1; guint has_minimize_func : 1; guint has_maximize_func : 1;