From 40a710dad0dae640dec209bee8c7c227561db83b Mon Sep 17 00:00:00 2001 From: Rob Adams Date: Sat, 17 Jan 2004 18:57:26 +0000 Subject: [PATCH] Don't show left/right/up/down if a window is sticky. Make "On Top" 2004-01-17 Rob Adams * src/window.c (meta_window_show_menu): Don't show left/right/up/down if a window is sticky. Make "On Top" insensitive for docks, splash screens, and desktops since it has no effect anyway. --- ChangeLog | 7 +++++++ src/window.c | 28 ++++++++++++++++++---------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 697372ecb..c21911b28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-01-17 Rob Adams + + * src/window.c (meta_window_show_menu): Don't show + left/right/up/down if a window is sticky. Make "On Top" + insensitive for docks, splash screens, and desktops since it has + no effect anyway. + 2004-01-10 Rob Adams * src/metacity.schemas.in: update default diff --git a/src/window.c b/src/window.c index 100b158d2..0ca2c29c2 100644 --- a/src/window.c +++ b/src/window.c @@ -5711,15 +5711,18 @@ meta_window_show_menu (MetaWindow *window, meta_workspace_index ( window->screen->active_workspace), &layout); - if (layout.current_col > 0) - ops |= META_MENU_OP_MOVE_LEFT; - if (layout.current_col < layout.cols - 1) - ops |= META_MENU_OP_MOVE_RIGHT; - if (layout.current_row > 0) - ops |= META_MENU_OP_MOVE_UP; - if (layout.current_row < layout.rows - 1) - ops |= META_MENU_OP_MOVE_DOWN; - + if (!window->on_all_workspaces) + { + if (layout.current_col > 0) + ops |= META_MENU_OP_MOVE_LEFT; + if (layout.current_col < layout.cols - 1) + ops |= META_MENU_OP_MOVE_RIGHT; + if (layout.current_row > 0) + ops |= META_MENU_OP_MOVE_UP; + if (layout.current_row < layout.rows - 1) + ops |= META_MENU_OP_MOVE_DOWN; + } + if (window->maximized) ops |= META_MENU_OP_UNMAXIMIZE; else @@ -5736,7 +5739,7 @@ meta_window_show_menu (MetaWindow *window, ops |= META_MENU_OP_UNSTICK; else ops |= META_MENU_OP_STICK; - + if (window->wm_state_above) ops |= META_MENU_OP_UNABOVE; else @@ -5762,6 +5765,11 @@ meta_window_show_menu (MetaWindow *window, if (window->always_sticky) insensitive |= META_MENU_OP_UNSTICK | META_MENU_OP_WORKSPACES; + + if ((window->type == META_WINDOW_DESKTOP) || + (window->type == META_WINDOW_DOCK) || + (window->type == META_WINDOW_SPLASHSCREEN)) + insensitive |= META_MENU_OP_ABOVE | META_MENU_OP_UNABOVE; menu = meta_ui_window_menu_new (window->screen->ui,