[mutter] Only show workspace and stick/unstick in menu item for primary monitor
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] Only show workspace and stick/unstick in menu item for primary monitor
- Date: Thu, 17 Mar 2011 12:55:10 +0000 (UTC)
commit 637cce0f915afe0f7e5db32ad24b78e267108927
Author: Alexander Larsson <alexl redhat com>
Date: Wed Mar 9 13:06:21 2011 +0100
Only show workspace and stick/unstick in menu item for primary monitor
If workspaces_only_on_primary then it makes no sense to have these
menu items on the monitors where workspaces don't take any effect.
https://bugzilla.gnome.org/show_bug.cgi?id=609258
src/core/window.c | 54 ++++++++++++++++++++++++++++------------------------
1 files changed, 29 insertions(+), 25 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index f61b97d..a0f1f47 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -7666,33 +7666,40 @@ meta_window_show_menu (MetaWindow *window,
window->type != META_WINDOW_DESKTOP)
ops |= META_MENU_OP_RECOVER;
- n_workspaces = meta_screen_get_n_workspaces (window->screen);
+ if (!meta_prefs_get_workspaces_only_on_primary () ||
+ meta_window_is_on_primary_monitor (window))
+ {
+ n_workspaces = meta_screen_get_n_workspaces (window->screen);
- if (n_workspaces > 1)
- ops |= META_MENU_OP_WORKSPACES;
+ if (n_workspaces > 1)
+ ops |= META_MENU_OP_WORKSPACES;
- meta_screen_calc_workspace_layout (window->screen,
- n_workspaces,
- meta_workspace_index ( window->screen->active_workspace),
- &layout);
+ meta_screen_calc_workspace_layout (window->screen,
+ n_workspaces,
+ meta_workspace_index ( window->screen->active_workspace),
+ &layout);
- if (!window->on_all_workspaces)
- {
- ltr = meta_ui_get_direction() == META_UI_DIRECTION_LTR;
+ if (!window->on_all_workspaces)
+ {
+ ltr = meta_ui_get_direction() == META_UI_DIRECTION_LTR;
+
+ if (layout.current_col > 0)
+ ops |= ltr ? META_MENU_OP_MOVE_LEFT : META_MENU_OP_MOVE_RIGHT;
+ if ((layout.current_col < layout.cols - 1) &&
+ (layout.current_row * layout.cols + (layout.current_col + 1) < n_workspaces))
+ ops |= ltr ? META_MENU_OP_MOVE_RIGHT : META_MENU_OP_MOVE_LEFT;
+ if (layout.current_row > 0)
+ ops |= META_MENU_OP_MOVE_UP;
+ if ((layout.current_row < layout.rows - 1) &&
+ ((layout.current_row + 1) * layout.cols + layout.current_col < n_workspaces))
+ ops |= META_MENU_OP_MOVE_DOWN;
+ }
- if (layout.current_col > 0)
- ops |= ltr ? META_MENU_OP_MOVE_LEFT : META_MENU_OP_MOVE_RIGHT;
- if ((layout.current_col < layout.cols - 1) &&
- (layout.current_row * layout.cols + (layout.current_col + 1) < n_workspaces))
- ops |= ltr ? META_MENU_OP_MOVE_RIGHT : META_MENU_OP_MOVE_LEFT;
- if (layout.current_row > 0)
- ops |= META_MENU_OP_MOVE_UP;
- if ((layout.current_row < layout.rows - 1) &&
- ((layout.current_row + 1) * layout.cols + layout.current_col < n_workspaces))
- ops |= META_MENU_OP_MOVE_DOWN;
- }
+ meta_screen_free_workspace_layout (&layout);
- meta_screen_free_workspace_layout (&layout);
+ ops |= META_MENU_OP_UNSTICK;
+ ops |= META_MENU_OP_STICK;
+ }
if (META_WINDOW_MAXIMIZED (window))
ops |= META_MENU_OP_UNMAXIMIZE;
@@ -7706,9 +7713,6 @@ meta_window_show_menu (MetaWindow *window,
ops |= META_MENU_OP_SHADE;
#endif
- ops |= META_MENU_OP_UNSTICK;
- ops |= META_MENU_OP_STICK;
-
if (window->wm_state_above)
ops |= META_MENU_OP_UNABOVE;
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]