mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
workspaces are all per-screen now, fix accordingly
2002-10-16 Havoc Pennington <hp@redhat.com> * src/workspace.c: workspaces are all per-screen now, fix accordingly * src/core.c: fix multihead workspace stuff * src/keybindings.c: multihead-rama * src/screen.c (meta_screen_show_desktop): new functions to replace display equivalents * src/display.c (meta_display_get_workspace_by_screen_index): get rid of this (meta_display_get_workspace_by_index): get rid of this (event_callback): handle _NET_SHOWING_DESKTOP message per-screen * src/screen.c (meta_screen_get_workspace_by_index): new function * src/screen.h (struct _MetaScreen): move workspace list, and showing_desktop flag, to be per-screen * src/window.c (window_query_root_pointer): return whether pointer is on window's screen (meta_window_handle_mouse_grab_op_event): don't use coordinates from other screens when updating a window operation on the current screen. I can't believe no one has reported this...
This commit is contained in:
parent
17ac646f70
commit
337812d51d
28
ChangeLog
28
ChangeLog
@ -1,3 +1,31 @@
|
||||
2002-10-16 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* src/workspace.c: workspaces are all per-screen now, fix
|
||||
accordingly
|
||||
|
||||
* src/core.c: fix multihead workspace stuff
|
||||
|
||||
* src/keybindings.c: multihead-rama
|
||||
|
||||
* src/screen.c (meta_screen_show_desktop): new functions to
|
||||
replace display equivalents
|
||||
|
||||
* src/display.c (meta_display_get_workspace_by_screen_index): get
|
||||
rid of this
|
||||
(meta_display_get_workspace_by_index): get rid of this
|
||||
(event_callback): handle _NET_SHOWING_DESKTOP message per-screen
|
||||
|
||||
* src/screen.c (meta_screen_get_workspace_by_index): new function
|
||||
|
||||
* src/screen.h (struct _MetaScreen): move workspace list, and
|
||||
showing_desktop flag, to be per-screen
|
||||
|
||||
* src/window.c (window_query_root_pointer): return whether pointer
|
||||
is on window's screen
|
||||
(meta_window_handle_mouse_grab_op_event): don't use coordinates
|
||||
from other screens when updating a window operation on the current
|
||||
screen. I can't believe no one has reported this...
|
||||
|
||||
2002-10-16 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* src/window.c (meta_window_client_message): update window layer
|
||||
|
15
src/core.c
15
src/core.c
@ -434,9 +434,8 @@ meta_core_change_workspace (Display *xdisplay,
|
||||
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
|
||||
|
||||
meta_window_change_workspace (window,
|
||||
meta_display_get_workspace_by_screen_index (display,
|
||||
window->screen,
|
||||
new_workspace));
|
||||
meta_screen_get_workspace_by_index (window->screen,
|
||||
new_workspace));
|
||||
}
|
||||
|
||||
int
|
||||
@ -456,7 +455,7 @@ meta_core_get_active_workspace (Screen *xscreen)
|
||||
|
||||
screen = meta_screen_for_x_screen (xscreen);
|
||||
|
||||
return meta_workspace_screen_index (screen->active_workspace);
|
||||
return meta_workspace_index (screen->active_workspace);
|
||||
}
|
||||
|
||||
int
|
||||
@ -624,13 +623,17 @@ meta_core_get_menu_accelerator (MetaMenuOp menu_op,
|
||||
|
||||
char *
|
||||
meta_core_get_workspace_name_with_index (Display *xdisplay,
|
||||
int index)
|
||||
Window xroot,
|
||||
int index)
|
||||
{
|
||||
MetaDisplay *display;
|
||||
MetaScreen *screen;
|
||||
MetaWorkspace *workspace;
|
||||
|
||||
display = meta_display_for_x_display (xdisplay);
|
||||
workspace = meta_display_get_workspace_by_index (display, index);
|
||||
screen = meta_display_screen_for_root (display, xroot);
|
||||
g_assert (screen != NULL);
|
||||
workspace = meta_screen_get_workspace_by_index (screen, index);
|
||||
return (workspace != NULL) ? workspace->name : NULL;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,8 @@ int meta_core_get_active_workspace (Screen *xscreen);
|
||||
int meta_core_get_frame_workspace (Display *xdisplay,
|
||||
Window frame_xwindow);
|
||||
char* meta_core_get_workspace_name_with_index (Display *xdisplay,
|
||||
int index);
|
||||
Window xroot,
|
||||
int index);
|
||||
|
||||
void meta_core_get_frame_extents (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
|
143
src/display.c
143
src/display.c
@ -261,7 +261,6 @@ meta_display_open (const char *name)
|
||||
display->error_traps = 0;
|
||||
display->error_trap_handler = NULL;
|
||||
display->server_grab_count = 0;
|
||||
display->workspaces = NULL;
|
||||
|
||||
display->pending_pings = NULL;
|
||||
display->autoraise_timeout_id = 0;
|
||||
@ -269,8 +268,6 @@ meta_display_open (const char *name)
|
||||
display->expected_focus_window = NULL;
|
||||
display->mru_list = NULL;
|
||||
|
||||
display->showing_desktop = FALSE;
|
||||
|
||||
/* FIXME copy the checks from GDK probably */
|
||||
display->static_gravity_works = g_getenv ("METACITY_USE_STATIC_GRAVITY") != NULL;
|
||||
|
||||
@ -1539,9 +1536,8 @@ event_callback (XEvent *event,
|
||||
space);
|
||||
|
||||
workspace =
|
||||
meta_display_get_workspace_by_screen_index (display,
|
||||
screen,
|
||||
space);
|
||||
meta_screen_get_workspace_by_index (screen,
|
||||
space);
|
||||
|
||||
if (workspace)
|
||||
meta_workspace_activate (workspace);
|
||||
@ -1569,9 +1565,9 @@ event_callback (XEvent *event,
|
||||
meta_verbose ("Request to %s desktop\n", showing_desktop ? "show" : "hide");
|
||||
|
||||
if (showing_desktop)
|
||||
meta_display_show_desktop (display);
|
||||
meta_screen_show_desktop (screen);
|
||||
else
|
||||
meta_display_unshow_desktop (display);
|
||||
meta_screen_unshow_desktop (screen);
|
||||
}
|
||||
else if (event->xclient.message_type ==
|
||||
display->atom_metacity_restart_message)
|
||||
@ -2145,56 +2141,6 @@ meta_display_unregister_x_window (MetaDisplay *display,
|
||||
remove_pending_pings_for_window (display, xwindow);
|
||||
}
|
||||
|
||||
MetaWorkspace*
|
||||
meta_display_get_workspace_by_index (MetaDisplay *display,
|
||||
int idx)
|
||||
{
|
||||
GList *tmp;
|
||||
|
||||
/* should be robust, index is maybe from an app */
|
||||
if (idx < 0)
|
||||
return NULL;
|
||||
|
||||
tmp = g_list_nth (display->workspaces, idx);
|
||||
|
||||
if (tmp == NULL)
|
||||
return NULL;
|
||||
else
|
||||
return tmp->data;
|
||||
}
|
||||
|
||||
MetaWorkspace*
|
||||
meta_display_get_workspace_by_screen_index (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
int idx)
|
||||
{
|
||||
GList *tmp;
|
||||
int i;
|
||||
|
||||
/* should be robust, idx is maybe from an app */
|
||||
if (idx < 0)
|
||||
return NULL;
|
||||
|
||||
i = 0;
|
||||
tmp = display->workspaces;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
MetaWorkspace *w = tmp->data;
|
||||
|
||||
if (w->screen == screen)
|
||||
{
|
||||
if (i == idx)
|
||||
return w;
|
||||
else
|
||||
++i;
|
||||
}
|
||||
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Cursor
|
||||
meta_display_create_x_cursor (MetaDisplay *display,
|
||||
MetaCursor cursor)
|
||||
@ -2712,31 +2658,6 @@ meta_display_increment_event_serial (MetaDisplay *display)
|
||||
display->atom_motif_wm_hints);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_display_update_showing_desktop_hint (MetaDisplay *display)
|
||||
{
|
||||
GSList *tmp;
|
||||
|
||||
unsigned long data[1];
|
||||
|
||||
data[0] = display->showing_desktop ? 1 : 0;
|
||||
|
||||
tmp = display->screens;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
MetaScreen *screen = tmp->data;
|
||||
|
||||
meta_error_trap_push (display);
|
||||
XChangeProperty (display->xdisplay, screen->xroot,
|
||||
display->atom_net_showing_desktop,
|
||||
XA_CARDINAL,
|
||||
32, PropModeReplace, (guchar*) data, 1);
|
||||
meta_error_trap_pop (display);
|
||||
|
||||
tmp = tmp->next;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_display_update_active_window_hint (MetaDisplay *display)
|
||||
{
|
||||
@ -2766,62 +2687,6 @@ meta_display_update_active_window_hint (MetaDisplay *display)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
queue_windows_showing (MetaDisplay *display)
|
||||
{
|
||||
GSList *windows;
|
||||
GSList *tmp;
|
||||
|
||||
windows = meta_display_list_windows (display);
|
||||
|
||||
tmp = windows;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
meta_window_queue_calc_showing (tmp->data);
|
||||
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
g_slist_free (windows);
|
||||
}
|
||||
|
||||
void
|
||||
meta_display_show_desktop (MetaDisplay *display)
|
||||
{
|
||||
|
||||
if (display->showing_desktop)
|
||||
return;
|
||||
|
||||
display->showing_desktop = TRUE;
|
||||
|
||||
queue_windows_showing (display);
|
||||
|
||||
meta_display_update_showing_desktop_hint (display);
|
||||
}
|
||||
|
||||
void
|
||||
meta_display_unshow_desktop (MetaDisplay *display)
|
||||
{
|
||||
GSList *tmp;
|
||||
|
||||
if (!display->showing_desktop)
|
||||
return;
|
||||
|
||||
display->showing_desktop = FALSE;
|
||||
|
||||
queue_windows_showing (display);
|
||||
|
||||
meta_display_update_showing_desktop_hint (display);
|
||||
|
||||
tmp = display->screens;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
MetaScreen *screen = tmp->data;
|
||||
meta_screen_focus_top_window (screen, NULL);
|
||||
tmp = tmp->next;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_display_queue_retheme_all_windows (MetaDisplay *display)
|
||||
{
|
||||
|
@ -164,9 +164,6 @@ struct _MetaDisplay
|
||||
*/
|
||||
GList *mru_list;
|
||||
|
||||
GList *workspaces;
|
||||
|
||||
guint showing_desktop : 1;
|
||||
guint static_gravity_works : 1;
|
||||
|
||||
/*< private-ish >*/
|
||||
@ -288,12 +285,6 @@ GSList* meta_display_list_windows (MetaDisplay *display);
|
||||
MetaDisplay* meta_display_for_x_display (Display *xdisplay);
|
||||
GSList* meta_displays_list (void);
|
||||
|
||||
MetaWorkspace* meta_display_get_workspace_by_index (MetaDisplay *display,
|
||||
int index);
|
||||
MetaWorkspace* meta_display_get_workspace_by_screen_index (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
int index);
|
||||
|
||||
Cursor meta_display_create_x_cursor (MetaDisplay *display,
|
||||
MetaCursor cursor);
|
||||
|
||||
@ -332,10 +323,6 @@ void meta_display_increment_event_serial (MetaDisplay *display);
|
||||
|
||||
void meta_display_update_active_window_hint (MetaDisplay *display);
|
||||
|
||||
/* Show/hide the desktop (temporarily hide all windows) */
|
||||
void meta_display_show_desktop (MetaDisplay *display);
|
||||
void meta_display_unshow_desktop (MetaDisplay *display);
|
||||
|
||||
guint32 meta_display_get_current_time (MetaDisplay *display);
|
||||
|
||||
/* utility goo */
|
||||
|
@ -34,116 +34,143 @@
|
||||
static gboolean all_bindings_disabled = FALSE;
|
||||
|
||||
typedef void (* MetaKeyHandlerFunc) (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
|
||||
static void handle_activate_workspace (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_activate_menu (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_tab_forward (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_cycle_forward (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_toggle_fullscreen (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_toggle_desktop (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_toggle_maximize (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_maximize (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_unmaximize (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_toggle_shade (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_close_window (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_minimize_window (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_begin_move (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_begin_resize (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_toggle_sticky (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_move_to_workspace (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_workspace_switch (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_raise_or_lower (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_raise (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_lower (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_run_command (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
|
||||
/* debug */
|
||||
static void handle_spew_mark (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
|
||||
static gboolean process_keyboard_move_grab (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
KeySym keysym);
|
||||
|
||||
static gboolean process_keyboard_resize_grab (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
KeySym keysym);
|
||||
|
||||
static gboolean process_tab_grab (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
XEvent *event,
|
||||
KeySym keysym);
|
||||
|
||||
static gboolean process_workspace_switch_grab (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
XEvent *event,
|
||||
KeySym keysym);
|
||||
|
||||
@ -1198,6 +1225,7 @@ process_event (MetaKeyBinding *bindings,
|
||||
int n_bindings,
|
||||
const MetaKeyHandler *handlers,
|
||||
MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
KeySym keysym)
|
||||
@ -1233,7 +1261,7 @@ process_event (MetaKeyBinding *bindings,
|
||||
"Running handler for %s\n",
|
||||
bindings[i].name);
|
||||
|
||||
(* handler->func) (display, window, event,
|
||||
(* handler->func) (display, screen, window, event,
|
||||
&bindings[i]);
|
||||
return;
|
||||
}
|
||||
@ -1262,8 +1290,13 @@ meta_display_process_key_event (MetaDisplay *display,
|
||||
if (all_bindings_disabled)
|
||||
return;
|
||||
|
||||
screen = meta_display_screen_for_xwindow (display,
|
||||
event->xany.window);
|
||||
/* if key event was on root window, we have a shortcut */
|
||||
screen = meta_display_screen_for_root (display, event->xkey.window);
|
||||
|
||||
/* else round-trip to server */
|
||||
if (screen == NULL)
|
||||
screen = meta_display_screen_for_xwindow (display,
|
||||
event->xany.window);
|
||||
|
||||
if (screen == NULL)
|
||||
return; /* event window is destroyed */
|
||||
@ -1292,13 +1325,13 @@ meta_display_process_key_event (MetaDisplay *display,
|
||||
process_event (display->screen_bindings,
|
||||
display->n_screen_bindings,
|
||||
screen_handlers,
|
||||
display, NULL, event, keysym);
|
||||
display, screen, NULL, event, keysym);
|
||||
|
||||
if (window)
|
||||
process_event (display->window_bindings,
|
||||
display->n_window_bindings,
|
||||
window_handlers,
|
||||
display, window, event, keysym);
|
||||
display, screen, window, event, keysym);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -1322,7 +1355,8 @@ meta_display_process_key_event (MetaDisplay *display,
|
||||
meta_topic (META_DEBUG_KEYBINDINGS,
|
||||
"Processing event for keyboard move\n");
|
||||
g_assert (window != NULL);
|
||||
handled = process_keyboard_move_grab (display, window, event, keysym);
|
||||
handled = process_keyboard_move_grab (display, screen,
|
||||
window, event, keysym);
|
||||
break;
|
||||
|
||||
case META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN:
|
||||
@ -1337,7 +1371,8 @@ meta_display_process_key_event (MetaDisplay *display,
|
||||
meta_topic (META_DEBUG_KEYBINDINGS,
|
||||
"Processing event for keyboard resize\n");
|
||||
g_assert (window != NULL);
|
||||
handled = process_keyboard_resize_grab (display, window, event, keysym);
|
||||
handled = process_keyboard_resize_grab (display, screen,
|
||||
window, event, keysym);
|
||||
break;
|
||||
|
||||
case META_GRAB_OP_KEYBOARD_TABBING_NORMAL:
|
||||
@ -1346,13 +1381,13 @@ meta_display_process_key_event (MetaDisplay *display,
|
||||
case META_GRAB_OP_KEYBOARD_ESCAPING_DOCK:
|
||||
meta_topic (META_DEBUG_KEYBINDINGS,
|
||||
"Processing event for keyboard tabbing/cycling\n");
|
||||
handled = process_tab_grab (display, event, keysym);
|
||||
handled = process_tab_grab (display, screen, event, keysym);
|
||||
break;
|
||||
|
||||
case META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING:
|
||||
meta_topic (META_DEBUG_KEYBINDINGS,
|
||||
"Processing event for keyboard workspace switching\n");
|
||||
handled = process_workspace_switch_grab (display, event, keysym);
|
||||
handled = process_workspace_switch_grab (display, screen, event, keysym);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -1372,6 +1407,7 @@ meta_display_process_key_event (MetaDisplay *display,
|
||||
|
||||
static gboolean
|
||||
process_keyboard_move_grab (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
KeySym keysym)
|
||||
@ -1478,6 +1514,7 @@ process_keyboard_move_grab (MetaDisplay *display,
|
||||
|
||||
static gboolean
|
||||
process_keyboard_resize_grab (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
KeySym keysym)
|
||||
@ -1860,14 +1897,15 @@ process_keyboard_resize_grab (MetaDisplay *display,
|
||||
|
||||
static gboolean
|
||||
process_tab_grab (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
XEvent *event,
|
||||
KeySym keysym)
|
||||
{
|
||||
MetaScreen *screen;
|
||||
MetaKeyBindingAction action;
|
||||
gboolean popup_not_showing;
|
||||
|
||||
screen = display->grab_screen;
|
||||
if (screen != display->grab_screen)
|
||||
return FALSE;
|
||||
|
||||
g_return_val_if_fail (screen->tab_popup != NULL, FALSE);
|
||||
|
||||
@ -2010,6 +2048,7 @@ switch_to_workspace (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_activate_workspace (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *event_window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
@ -2022,20 +2061,12 @@ handle_activate_workspace (MetaDisplay *display,
|
||||
workspace = NULL;
|
||||
if (which < 0)
|
||||
{
|
||||
MetaScreen *screen;
|
||||
|
||||
screen = meta_display_screen_for_root (display,
|
||||
event->xkey.root);
|
||||
|
||||
if (screen == NULL)
|
||||
return;
|
||||
|
||||
workspace = meta_workspace_get_neighbor (screen->active_workspace,
|
||||
which);
|
||||
}
|
||||
else
|
||||
{
|
||||
workspace = meta_display_get_workspace_by_index (display, which);
|
||||
workspace = meta_screen_get_workspace_by_index (screen, which);
|
||||
}
|
||||
|
||||
if (workspace)
|
||||
@ -2091,6 +2122,7 @@ error_on_command (int command_index,
|
||||
|
||||
static void
|
||||
handle_run_command (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
@ -2130,13 +2162,14 @@ handle_run_command (MetaDisplay *display,
|
||||
|
||||
static gboolean
|
||||
process_workspace_switch_grab (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
XEvent *event,
|
||||
KeySym keysym)
|
||||
{
|
||||
MetaScreen *screen;
|
||||
MetaWorkspace *workspace;
|
||||
|
||||
screen = display->grab_screen;
|
||||
if (screen != display->grab_screen)
|
||||
return FALSE;
|
||||
|
||||
g_return_val_if_fail (screen->tab_popup != NULL, FALSE);
|
||||
|
||||
@ -2241,18 +2274,20 @@ process_workspace_switch_grab (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_toggle_desktop (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
{
|
||||
if (display->showing_desktop)
|
||||
meta_display_unshow_desktop (display);
|
||||
if (screen->showing_desktop)
|
||||
meta_screen_unshow_desktop (screen);
|
||||
else
|
||||
meta_display_show_desktop (display);
|
||||
meta_screen_show_desktop (screen);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_activate_menu (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *event_window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
@ -2305,12 +2340,12 @@ cycle_op_from_tab_type (MetaTabList type)
|
||||
|
||||
static void
|
||||
do_choose_window (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *event_window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding,
|
||||
gboolean show_popup)
|
||||
{
|
||||
MetaScreen *screen;
|
||||
MetaTabList type;
|
||||
gboolean backward;
|
||||
MetaWindow *initial_selection;
|
||||
@ -2320,17 +2355,6 @@ do_choose_window (MetaDisplay *display,
|
||||
meta_topic (META_DEBUG_KEYBINDINGS,
|
||||
"Tab list = %d show_popup = %d\n", type, show_popup);
|
||||
|
||||
screen = meta_display_screen_for_root (display,
|
||||
event->xkey.root);
|
||||
|
||||
if (screen == NULL)
|
||||
{
|
||||
meta_topic (META_DEBUG_KEYBINDINGS,
|
||||
"No screen for root 0x%lx, not doing choose_window\n",
|
||||
event->xkey.root);
|
||||
return;
|
||||
}
|
||||
|
||||
/* backward if shift is down, this isn't configurable */
|
||||
backward = (event->xkey.state & ShiftMask) != 0;
|
||||
|
||||
@ -2377,24 +2401,29 @@ do_choose_window (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_tab_forward (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *event_window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
{
|
||||
do_choose_window (display, event_window, event, binding, TRUE);
|
||||
do_choose_window (display, screen,
|
||||
event_window, event, binding, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_cycle_forward (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *event_window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
{
|
||||
do_choose_window (display, event_window, event, binding, FALSE);
|
||||
do_choose_window (display, screen,
|
||||
event_window, event, binding, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_toggle_fullscreen (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
@ -2410,6 +2439,7 @@ handle_toggle_fullscreen (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_toggle_maximize (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
@ -2425,6 +2455,7 @@ handle_toggle_maximize (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_maximize (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
@ -2438,6 +2469,7 @@ handle_maximize (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_unmaximize (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
@ -2451,6 +2483,7 @@ handle_unmaximize (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_toggle_shade (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
@ -2466,6 +2499,7 @@ handle_toggle_shade (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_close_window (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
@ -2477,6 +2511,7 @@ handle_close_window (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_minimize_window (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
@ -2488,6 +2523,7 @@ handle_minimize_window (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_begin_move (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
@ -2502,6 +2538,7 @@ handle_begin_move (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_begin_resize (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
@ -2516,6 +2553,7 @@ handle_begin_resize (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_toggle_sticky (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
@ -2531,6 +2569,7 @@ handle_toggle_sticky (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_move_to_workspace (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
@ -2546,20 +2585,12 @@ handle_move_to_workspace (MetaDisplay *display,
|
||||
workspace = NULL;
|
||||
if (which < 0)
|
||||
{
|
||||
MetaScreen *screen;
|
||||
|
||||
screen = meta_display_screen_for_root (display,
|
||||
event->xkey.root);
|
||||
|
||||
if (screen == NULL)
|
||||
return;
|
||||
|
||||
workspace = meta_workspace_get_neighbor (screen->active_workspace,
|
||||
which);
|
||||
}
|
||||
else
|
||||
{
|
||||
workspace = meta_display_get_workspace_by_index (display, which);
|
||||
workspace = meta_screen_get_workspace_by_index (screen, which);
|
||||
}
|
||||
|
||||
if (workspace)
|
||||
@ -2576,21 +2607,13 @@ handle_move_to_workspace (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_raise_or_lower (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
{
|
||||
/* Get window at pointer */
|
||||
|
||||
MetaScreen *screen;
|
||||
|
||||
/* FIXME I'm really not sure why we get the screen here
|
||||
* instead of using window->screen
|
||||
*/
|
||||
screen = meta_display_screen_for_root (display, event->xbutton.root);
|
||||
if (screen == NULL)
|
||||
return;
|
||||
|
||||
if (window)
|
||||
{
|
||||
MetaWindow *above = NULL;
|
||||
@ -2630,6 +2653,7 @@ handle_raise_or_lower (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_raise (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
@ -2642,6 +2666,7 @@ handle_raise (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_lower (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
@ -2654,22 +2679,17 @@ handle_lower (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_workspace_switch (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
{
|
||||
int motion;
|
||||
MetaScreen *screen;
|
||||
|
||||
motion = GPOINTER_TO_INT (binding->handler->data);
|
||||
|
||||
g_assert (motion < 0);
|
||||
|
||||
screen = meta_display_screen_for_root (display,
|
||||
event->xkey.root);
|
||||
if (screen == NULL)
|
||||
return;
|
||||
|
||||
meta_topic (META_DEBUG_KEYBINDINGS,
|
||||
"Starting tab between workspaces, showing popup\n");
|
||||
|
||||
@ -2703,6 +2723,7 @@ handle_workspace_switch (MetaDisplay *display,
|
||||
|
||||
static void
|
||||
handle_spew_mark (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
|
22
src/menu.c
22
src/menu.c
@ -133,12 +133,13 @@ activate_cb (GtkWidget *menuitem, gpointer data)
|
||||
*/
|
||||
static char *
|
||||
get_workspace_name_with_accel (Display *display,
|
||||
int index)
|
||||
Window xroot,
|
||||
int index)
|
||||
{
|
||||
char *name;
|
||||
unsigned int number;
|
||||
|
||||
name = meta_core_get_workspace_name_with_index (display, index);
|
||||
name = meta_core_get_workspace_name_with_index (display, xroot, index);
|
||||
|
||||
/*
|
||||
* If the name is of the form "Workspace x" where x is an unsigned
|
||||
@ -312,8 +313,21 @@ meta_window_menu_new (MetaFrames *frames,
|
||||
{
|
||||
GtkWidget *mi;
|
||||
Display *display;
|
||||
Window xroot;
|
||||
|
||||
display = gdk_x11_drawable_get_xdisplay(GTK_WIDGET(frames)->window);
|
||||
display = gdk_x11_drawable_get_xdisplay (GTK_WIDGET (frames)->window);
|
||||
|
||||
#ifdef HAVE_GTK_MULTIHEAD
|
||||
{
|
||||
GdkScreen *screen;
|
||||
screen = gdk_drawable_get_screen (GTK_WIDGET (frames)->window);
|
||||
xroot = GDK_DRAWABLE_XID (gdk_screen_get_root_window (screen));
|
||||
}
|
||||
#else
|
||||
{
|
||||
xroot = gdk_x11_get_default_root_xwindow ();
|
||||
}
|
||||
#endif
|
||||
|
||||
i = 0;
|
||||
while (i < n_workspaces)
|
||||
@ -327,7 +341,7 @@ meta_window_menu_new (MetaFrames *frames,
|
||||
i + 1,
|
||||
&key, &mods);
|
||||
|
||||
name = get_workspace_name_with_accel (display, i);
|
||||
name = get_workspace_name_with_accel (display, xroot, i);
|
||||
if (ops & META_MENU_OP_UNSTICK)
|
||||
label = g_strdup_printf (_("Only on %s"), name);
|
||||
else
|
||||
|
@ -56,7 +56,9 @@ if test -z "$ONLY_WM"; then
|
||||
|
||||
echo "Launching clients"
|
||||
if test -n "$TEST_CLIENT"; then
|
||||
DISPLAY=$CLIENT_DISPLAY $TEST_CLIENT &
|
||||
for I in `seq 0 $SCREENS`; do
|
||||
DISPLAY=$CLIENT_DISPLAY.$I $TEST_CLIENT &
|
||||
done
|
||||
fi
|
||||
|
||||
if test $CLIENTS != 0; then
|
||||
@ -79,7 +81,9 @@ if test -z "$ONLY_WM"; then
|
||||
|
||||
usleep 50000
|
||||
|
||||
DISPLAY=$CLIENT_DISPLAY xsetroot -solid royalblue3
|
||||
for I in `seq 0 $SCREENS`; do
|
||||
DISPLAY=$CLIENT_DISPLAY.$I xsetroot -solid royalblue3
|
||||
done
|
||||
fi
|
||||
|
||||
if test -z "$ONLY_SETUP"; then
|
||||
|
119
src/screen.c
119
src/screen.c
@ -523,11 +523,14 @@ meta_screen_new (MetaDisplay *display,
|
||||
screen->work_area_idle = 0;
|
||||
|
||||
screen->active_workspace = NULL;
|
||||
screen->workspaces = NULL;
|
||||
screen->rows_of_workspaces = 1;
|
||||
screen->columns_of_workspaces = -1;
|
||||
screen->vertical_workspaces = FALSE;
|
||||
screen->starting_corner = META_SCREEN_TOPLEFT;
|
||||
|
||||
screen->showing_desktop = FALSE;
|
||||
|
||||
screen->xinerama_infos = NULL;
|
||||
screen->n_xinerama_infos = 0;
|
||||
screen->last_xinerama_index = 0;
|
||||
@ -810,23 +813,35 @@ meta_screen_queue_window_resizes (MetaScreen *screen)
|
||||
|
||||
int
|
||||
meta_screen_get_n_workspaces (MetaScreen *screen)
|
||||
{
|
||||
return g_list_length (screen->workspaces);
|
||||
}
|
||||
|
||||
MetaWorkspace*
|
||||
meta_screen_get_workspace_by_index (MetaScreen *screen,
|
||||
int idx)
|
||||
{
|
||||
GList *tmp;
|
||||
int i;
|
||||
|
||||
/* should be robust, idx is maybe from an app */
|
||||
if (idx < 0)
|
||||
return NULL;
|
||||
|
||||
i = 0;
|
||||
tmp = screen->display->workspaces;
|
||||
tmp = screen->workspaces;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
MetaWorkspace *w = tmp->data;
|
||||
|
||||
if (w->screen == screen)
|
||||
++i;
|
||||
if (i == idx)
|
||||
return w;
|
||||
|
||||
++i;
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
return i;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -867,21 +882,17 @@ update_num_workspaces (MetaScreen *screen)
|
||||
last_remaining = NULL;
|
||||
extras = NULL;
|
||||
i = 0;
|
||||
tmp = screen->display->workspaces;
|
||||
tmp = screen->workspaces;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
MetaWorkspace *w = tmp->data;
|
||||
|
||||
if (w->screen == screen)
|
||||
{
|
||||
++i;
|
||||
|
||||
if (i > new_num)
|
||||
extras = g_list_prepend (extras, w);
|
||||
else
|
||||
last_remaining = w;
|
||||
}
|
||||
if (i > new_num)
|
||||
extras = g_list_prepend (extras, w);
|
||||
else
|
||||
last_remaining = w;
|
||||
|
||||
++i;
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
@ -1078,7 +1089,7 @@ meta_screen_ensure_workspace_popup (MetaScreen *screen)
|
||||
if (k >= len)
|
||||
break;
|
||||
|
||||
workspace = meta_display_get_workspace_by_index (screen->display, k);
|
||||
workspace = meta_screen_get_workspace_by_index (screen, k);
|
||||
g_assert (workspace);
|
||||
|
||||
entries[iter].key = (MetaTabEntryKey) workspace;
|
||||
@ -1096,7 +1107,7 @@ meta_screen_ensure_workspace_popup (MetaScreen *screen)
|
||||
{
|
||||
MetaWorkspace *workspace;
|
||||
|
||||
workspace = meta_display_get_workspace_by_index (screen->display, i);
|
||||
workspace = meta_screen_get_workspace_by_index (screen, i);
|
||||
|
||||
g_assert (workspace);
|
||||
|
||||
@ -1362,17 +1373,14 @@ meta_screen_update_workspace_names (MetaScreen *screen)
|
||||
}
|
||||
|
||||
i = 0;
|
||||
tmp = screen->display->workspaces;
|
||||
tmp = screen->workspaces;
|
||||
while (tmp != NULL && i < n_names)
|
||||
{
|
||||
MetaWorkspace *w = tmp->data;
|
||||
|
||||
if (w->screen == screen)
|
||||
{
|
||||
meta_workspace_set_name (w, names[i]);
|
||||
meta_workspace_set_name (w, names[i]);
|
||||
|
||||
++i;
|
||||
}
|
||||
++i;
|
||||
|
||||
tmp = tmp->next;
|
||||
}
|
||||
@ -1413,7 +1421,7 @@ set_work_area_hint (MetaScreen *screen)
|
||||
|
||||
num_workspaces = meta_screen_get_n_workspaces (screen);
|
||||
data = g_new (unsigned long, num_workspaces * 4);
|
||||
tmp_list = screen->display->workspaces;
|
||||
tmp_list = screen->workspaces;
|
||||
tmp = data;
|
||||
|
||||
while (tmp_list != NULL)
|
||||
@ -1543,3 +1551,68 @@ meta_screen_resize (MetaScreen *screen,
|
||||
/* Queue a resize on all the windows */
|
||||
meta_screen_foreach_window (screen, meta_screen_resize_func, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
update_showing_desktop_hint (MetaScreen *screen)
|
||||
{
|
||||
unsigned long data[1];
|
||||
|
||||
data[0] = screen->showing_desktop ? 1 : 0;
|
||||
|
||||
meta_error_trap_push (screen->display);
|
||||
XChangeProperty (screen->display->xdisplay, screen->xroot,
|
||||
screen->display->atom_net_showing_desktop,
|
||||
XA_CARDINAL,
|
||||
32, PropModeReplace, (guchar*) data, 1);
|
||||
meta_error_trap_pop (screen->display);
|
||||
}
|
||||
|
||||
static void
|
||||
queue_windows_showing (MetaScreen *screen)
|
||||
{
|
||||
GSList *windows;
|
||||
GSList *tmp;
|
||||
|
||||
windows = meta_display_list_windows (screen->display);
|
||||
|
||||
tmp = windows;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
MetaWindow *w = tmp->data;
|
||||
|
||||
if (w->screen == screen)
|
||||
meta_window_queue_calc_showing (w);
|
||||
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
g_slist_free (windows);
|
||||
}
|
||||
|
||||
void
|
||||
meta_screen_show_desktop (MetaScreen *screen)
|
||||
{
|
||||
if (screen->showing_desktop)
|
||||
return;
|
||||
|
||||
screen->showing_desktop = TRUE;
|
||||
|
||||
queue_windows_showing (screen);
|
||||
|
||||
update_showing_desktop_hint (screen);
|
||||
}
|
||||
|
||||
void
|
||||
meta_screen_unshow_desktop (MetaScreen *screen)
|
||||
{
|
||||
if (!screen->showing_desktop)
|
||||
return;
|
||||
|
||||
screen->showing_desktop = FALSE;
|
||||
|
||||
queue_windows_showing (screen);
|
||||
|
||||
update_showing_desktop_hint (screen);
|
||||
|
||||
meta_screen_focus_top_window (screen, NULL);
|
||||
}
|
||||
|
11
src/screen.h
11
src/screen.h
@ -64,6 +64,8 @@ struct _MetaScreen
|
||||
|
||||
MetaWorkspace *active_workspace;
|
||||
|
||||
GList *workspaces;
|
||||
|
||||
MetaStack *stack;
|
||||
|
||||
MetaCursor current_cursor;
|
||||
@ -87,6 +89,7 @@ struct _MetaScreen
|
||||
|
||||
guint keys_grabbed : 1;
|
||||
guint all_keys_grabbed : 1;
|
||||
guint showing_desktop : 1;
|
||||
|
||||
int closing;
|
||||
};
|
||||
@ -104,6 +107,9 @@ void meta_screen_queue_window_resizes (MetaScreen *scre
|
||||
|
||||
int meta_screen_get_n_workspaces (MetaScreen *screen);
|
||||
|
||||
MetaWorkspace* meta_screen_get_workspace_by_index (MetaScreen *screen,
|
||||
int index);
|
||||
|
||||
void meta_screen_set_cursor (MetaScreen *screen,
|
||||
MetaCursor cursor);
|
||||
|
||||
@ -136,4 +142,9 @@ void meta_screen_resize (MetaScreen *screen,
|
||||
int height);
|
||||
|
||||
|
||||
/* Show/hide the desktop (temporarily hide all windows) */
|
||||
void meta_screen_show_desktop (MetaScreen *screen);
|
||||
void meta_screen_unshow_desktop (MetaScreen *screen);
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1008,7 +1008,7 @@ save_state (void)
|
||||
while (w != NULL)
|
||||
{
|
||||
int n;
|
||||
n = meta_workspace_screen_index (w->data);
|
||||
n = meta_workspace_index (w->data);
|
||||
fprintf (outfile,
|
||||
" <workspace index=\"%d\"/>\n", n);
|
||||
|
||||
|
64
src/window.c
64
src/window.c
@ -522,9 +522,8 @@ meta_window_new (MetaDisplay *display, Window xwindow,
|
||||
window->desc, window->initial_workspace);
|
||||
|
||||
space =
|
||||
meta_display_get_workspace_by_screen_index (window->display,
|
||||
window->screen,
|
||||
window->initial_workspace);
|
||||
meta_screen_get_workspace_by_index (window->screen,
|
||||
window->initial_workspace);
|
||||
|
||||
if (space)
|
||||
meta_workspace_add_window (space, window);
|
||||
@ -640,10 +639,10 @@ meta_window_new (MetaDisplay *display, Window xwindow,
|
||||
meta_stack_thaw (window->screen->stack);
|
||||
|
||||
/* disable show desktop mode unless we're a desktop component */
|
||||
if (window->display->showing_desktop &&
|
||||
if (window->screen->showing_desktop &&
|
||||
window->type != META_WINDOW_DESKTOP &&
|
||||
window->type != META_WINDOW_DOCK)
|
||||
meta_display_unshow_desktop (window->display);
|
||||
meta_screen_unshow_desktop (window->screen);
|
||||
|
||||
meta_window_queue_calc_showing (window);
|
||||
|
||||
@ -725,9 +724,8 @@ meta_window_apply_session_info (MetaWindow *window,
|
||||
MetaWorkspace *space;
|
||||
|
||||
space =
|
||||
meta_display_get_workspace_by_screen_index (window->display,
|
||||
window->screen,
|
||||
GPOINTER_TO_INT (tmp->data));
|
||||
meta_screen_get_workspace_by_index (window->screen,
|
||||
GPOINTER_TO_INT (tmp->data));
|
||||
|
||||
if (space)
|
||||
spaces = g_slist_prepend (spaces, space);
|
||||
@ -757,7 +755,7 @@ meta_window_apply_session_info (MetaWindow *window,
|
||||
meta_topic (META_DEBUG_SM,
|
||||
"Restoring saved window %s to workspace %d\n",
|
||||
window->desc,
|
||||
meta_workspace_screen_index (space));
|
||||
meta_workspace_index (space));
|
||||
|
||||
tmp = tmp->next;
|
||||
}
|
||||
@ -1110,7 +1108,7 @@ meta_window_calc_showing (MetaWindow *window)
|
||||
/* 3. See if we're in "show desktop" mode */
|
||||
|
||||
if (showing &&
|
||||
window->display->showing_desktop &&
|
||||
window->screen->showing_desktop &&
|
||||
window->type != META_WINDOW_DESKTOP &&
|
||||
window->type != META_WINDOW_DOCK)
|
||||
{
|
||||
@ -1609,8 +1607,8 @@ meta_window_minimize (MetaWindow *window)
|
||||
void
|
||||
meta_window_unminimize (MetaWindow *window)
|
||||
{
|
||||
if (window->display->showing_desktop)
|
||||
meta_display_unshow_desktop (window->display);
|
||||
if (window->screen->showing_desktop)
|
||||
meta_screen_unshow_desktop (window->screen);
|
||||
|
||||
if (window->minimized)
|
||||
{
|
||||
@ -1836,10 +1834,10 @@ meta_window_activate (MetaWindow *window,
|
||||
guint32 timestamp)
|
||||
{
|
||||
/* disable show desktop mode unless we're a desktop component */
|
||||
if (window->display->showing_desktop &&
|
||||
if (window->screen->showing_desktop &&
|
||||
window->type != META_WINDOW_DESKTOP &&
|
||||
window->type != META_WINDOW_DOCK)
|
||||
meta_display_unshow_desktop (window->display);
|
||||
meta_screen_unshow_desktop (window->screen);
|
||||
|
||||
/* Get window on current workspace */
|
||||
if (!meta_window_visible_on_workspace (window,
|
||||
@ -2957,7 +2955,7 @@ meta_window_get_net_wm_desktop (MetaWindow *window)
|
||||
g_list_length (window->workspaces) > 1)
|
||||
return 0xFFFFFFFF;
|
||||
else
|
||||
return meta_workspace_screen_index (window->workspaces->data);
|
||||
return meta_workspace_index (window->workspaces->data);
|
||||
}
|
||||
|
||||
int
|
||||
@ -3274,9 +3272,8 @@ meta_window_client_message (MetaWindow *window,
|
||||
window->desc, space);
|
||||
|
||||
workspace =
|
||||
meta_display_get_workspace_by_screen_index (display,
|
||||
window->screen,
|
||||
space);
|
||||
meta_screen_get_workspace_by_index (window->screen,
|
||||
space);
|
||||
|
||||
if (workspace)
|
||||
{
|
||||
@ -4984,7 +4981,7 @@ static GList*
|
||||
meta_window_get_workspaces (MetaWindow *window)
|
||||
{
|
||||
if (window->on_all_workspaces)
|
||||
return window->display->workspaces;
|
||||
return window->screen->workspaces;
|
||||
else
|
||||
return window->workspaces;
|
||||
}
|
||||
@ -5864,9 +5861,8 @@ menu_callback (MetaWindowMenu *menu,
|
||||
MetaWorkspace *workspace;
|
||||
|
||||
workspace =
|
||||
meta_display_get_workspace_by_screen_index (window->display,
|
||||
window->screen,
|
||||
workspace_index);
|
||||
meta_screen_get_workspace_by_index (window->screen,
|
||||
workspace_index);
|
||||
|
||||
if (workspace)
|
||||
{
|
||||
@ -5983,7 +5979,7 @@ meta_window_show_menu (MetaWindow *window,
|
||||
meta_ui_window_menu_popup (menu, root_x, root_y, button, timestamp);
|
||||
}
|
||||
|
||||
static void
|
||||
static gboolean
|
||||
window_query_root_pointer (MetaWindow *window,
|
||||
int *x, int *y)
|
||||
{
|
||||
@ -6010,6 +6006,8 @@ window_query_root_pointer (MetaWindow *window,
|
||||
*x = root_x_return;
|
||||
if (y)
|
||||
*y = root_y_return;
|
||||
|
||||
return root_return == window->screen->xroot;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -6167,8 +6165,9 @@ meta_window_handle_mouse_grab_op_event (MetaWindow *window,
|
||||
case META_GRAB_OP_MOVING:
|
||||
case META_GRAB_OP_KEYBOARD_MOVING:
|
||||
clear_moveresize_time (window);
|
||||
update_move (window, event->xbutton.state,
|
||||
event->xbutton.x_root, event->xbutton.y_root);
|
||||
if (event->xbutton.root == window->screen->xroot)
|
||||
update_move (window, event->xbutton.state,
|
||||
event->xbutton.x_root, event->xbutton.y_root);
|
||||
break;
|
||||
|
||||
case META_GRAB_OP_RESIZING_E:
|
||||
@ -6188,7 +6187,8 @@ meta_window_handle_mouse_grab_op_event (MetaWindow *window,
|
||||
case META_GRAB_OP_KEYBOARD_RESIZING_SW:
|
||||
case META_GRAB_OP_KEYBOARD_RESIZING_NW:
|
||||
clear_moveresize_time (window);
|
||||
update_resize (window, event->xbutton.x_root, event->xbutton.y_root);
|
||||
if (event->xbutton.root == window->screen->xroot)
|
||||
update_resize (window, event->xbutton.x_root, event->xbutton.y_root);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -6205,10 +6205,10 @@ meta_window_handle_mouse_grab_op_event (MetaWindow *window,
|
||||
case META_GRAB_OP_KEYBOARD_MOVING:
|
||||
{
|
||||
int x, y;
|
||||
window_query_root_pointer (window, &x, &y);
|
||||
update_move (window,
|
||||
event->xbutton.state,
|
||||
x, y);
|
||||
if (window_query_root_pointer (window, &x, &y))
|
||||
update_move (window,
|
||||
event->xbutton.state,
|
||||
x, y);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -6230,8 +6230,8 @@ meta_window_handle_mouse_grab_op_event (MetaWindow *window,
|
||||
case META_GRAB_OP_KEYBOARD_RESIZING_NW:
|
||||
{
|
||||
int x, y;
|
||||
window_query_root_pointer (window, &x, &y);
|
||||
update_resize (window, x, y);
|
||||
if (window_query_root_pointer (window, &x, &y))
|
||||
update_resize (window, x, y);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -37,8 +37,8 @@ meta_workspace_new (MetaScreen *screen)
|
||||
workspace = g_new (MetaWorkspace, 1);
|
||||
|
||||
workspace->screen = screen;
|
||||
workspace->screen->display->workspaces =
|
||||
g_list_append (workspace->screen->display->workspaces, workspace);
|
||||
workspace->screen->workspaces =
|
||||
g_list_append (workspace->screen->workspaces, workspace);
|
||||
workspace->windows = NULL;
|
||||
|
||||
workspace->work_area.x = 0;
|
||||
@ -83,8 +83,8 @@ meta_workspace_free (MetaWorkspace *workspace)
|
||||
|
||||
screen = workspace->screen;
|
||||
|
||||
workspace->screen->display->workspaces =
|
||||
g_list_remove (workspace->screen->display->workspaces, workspace);
|
||||
workspace->screen->workspaces =
|
||||
g_list_remove (workspace->screen->workspaces, workspace);
|
||||
|
||||
g_free (workspace->name);
|
||||
|
||||
@ -234,7 +234,7 @@ meta_workspace_index (MetaWorkspace *workspace)
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
tmp = workspace->screen->display->workspaces;
|
||||
tmp = workspace->screen->workspaces;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
if (tmp->data == workspace)
|
||||
@ -249,31 +249,6 @@ meta_workspace_index (MetaWorkspace *workspace)
|
||||
return -1; /* compiler warnings */
|
||||
}
|
||||
|
||||
int
|
||||
meta_workspace_screen_index (MetaWorkspace *workspace)
|
||||
{
|
||||
GList *tmp;
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
tmp = workspace->screen->display->workspaces;
|
||||
while (tmp != NULL)
|
||||
{
|
||||
MetaWorkspace *w = tmp->data;
|
||||
|
||||
if (tmp->data == workspace)
|
||||
return i;
|
||||
|
||||
if (w->screen == workspace->screen)
|
||||
++i;
|
||||
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
||||
meta_bug ("Workspace does not exist to index!\n");
|
||||
return -1; /* compiler warnings */
|
||||
}
|
||||
|
||||
/* get windows contained on workspace, including workspace->windows
|
||||
* and also sticky windows.
|
||||
*/
|
||||
@ -309,7 +284,7 @@ set_active_space_hint (MetaScreen *screen)
|
||||
{
|
||||
unsigned long data[1];
|
||||
|
||||
data[0] = meta_workspace_screen_index (screen->active_workspace);
|
||||
data[0] = meta_workspace_index (screen->active_workspace);
|
||||
|
||||
meta_verbose ("Setting _NET_CURRENT_DESKTOP to %ld\n", data[0]);
|
||||
|
||||
@ -541,8 +516,8 @@ meta_workspace_get_neighbor (MetaWorkspace *workspace,
|
||||
|
||||
meta_verbose ("Neighbor space is %d\n", i);
|
||||
|
||||
return meta_display_get_workspace_by_index (workspace->screen->display,
|
||||
i);
|
||||
return meta_screen_get_workspace_by_index (workspace->screen,
|
||||
i);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -60,7 +60,6 @@ gboolean meta_workspace_contains_window (MetaWorkspace *workspace,
|
||||
MetaWindow *window);
|
||||
void meta_workspace_activate (MetaWorkspace *workspace);
|
||||
int meta_workspace_index (MetaWorkspace *workspace);
|
||||
int meta_workspace_screen_index (MetaWorkspace *workspace);
|
||||
GList* meta_workspace_list_windows (MetaWorkspace *workspace);
|
||||
|
||||
void meta_workspace_invalidate_work_area (MetaWorkspace *workspace);
|
||||
|
Loading…
Reference in New Issue
Block a user