mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 09:00:42 -05:00
Add Alt + left/right arrow to move between workspaces.
2001-08-03 Havoc Pennington <hp@pobox.com> * src/keybindings.c: Add Alt + left/right arrow to move between workspaces. * src/screen.c (set_wm_check_hint): put property pointing back to itself on the _WIN_SUPPORTING_WM_CHECK window.
This commit is contained in:
parent
204cf63805
commit
0ee26a5168
@ -1,3 +1,11 @@
|
||||
2001-08-03 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* src/keybindings.c: Add Alt + left/right arrow to
|
||||
move between workspaces.
|
||||
|
||||
* src/screen.c (set_wm_check_hint): put property pointing back to
|
||||
itself on the _WIN_SUPPORTING_WM_CHECK window.
|
||||
|
||||
2001-08-03 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* src/display.c (event_callback): push error trap around configure
|
||||
|
11
README
11
README
@ -42,6 +42,8 @@ METACITY FEATURES
|
||||
Alt-Tab forward cycle window focus
|
||||
Alt-Shift-Tab backward cycle focus
|
||||
Alt-Escape focus previous window
|
||||
Alt-Left Arrow previous workspace
|
||||
Alt-Right Arrow next workspace
|
||||
|
||||
- Window keybindings:
|
||||
Alt-space window menu
|
||||
@ -195,15 +197,6 @@ METACITY BUGS, NON-FEATURES, AND CAVEATS
|
||||
window cycling that I would like to copy. (The little
|
||||
popup window thing.)
|
||||
|
||||
- People seem to like shortcuts using arrow keys for moving
|
||||
between workspaces. My only question here is that I'm not sure
|
||||
what the spatial relationship between workspaces is.
|
||||
(Are they in a grid, or a horizontal row, or what.)
|
||||
I think we may need a window manager spec extension to
|
||||
share this information between the WM and the pager.
|
||||
We could add left/right arrow and pretend they're in
|
||||
a row for the short term though.
|
||||
|
||||
- Should Metacity support flipping in right-to-left locales?
|
||||
I don't know what window managers look like in a right-to-left
|
||||
locale. I assume the window titles should be right-justified;
|
||||
|
@ -1288,6 +1288,10 @@ meta_display_get_workspace_by_index (MetaDisplay *display,
|
||||
{
|
||||
GList *tmp;
|
||||
|
||||
/* should be robust, index is maybe from an app */
|
||||
if (index < 0)
|
||||
return NULL;
|
||||
|
||||
tmp = g_list_nth (display->workspaces, index);
|
||||
|
||||
if (tmp == NULL)
|
||||
@ -1304,6 +1308,10 @@ meta_display_get_workspace_by_screen_index (MetaDisplay *display,
|
||||
GList *tmp;
|
||||
int i;
|
||||
|
||||
/* should be robust, index is maybe from an app */
|
||||
if (index < 0)
|
||||
return NULL;
|
||||
|
||||
i = 0;
|
||||
tmp = display->workspaces;
|
||||
while (tmp != NULL)
|
||||
|
@ -57,6 +57,14 @@ static void handle_focus_previous (MetaDisplay *display,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
gpointer data);
|
||||
static void handle_workspace_left (MetaDisplay *display,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
gpointer data);
|
||||
static void handle_workspace_right (MetaDisplay *display,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
gpointer data);
|
||||
|
||||
typedef struct _MetaKeyBinding MetaKeyBinding;
|
||||
|
||||
@ -89,6 +97,8 @@ static MetaKeyBinding screen_bindings[] = {
|
||||
{ XK_ISO_Left_Tab, ShiftMask | Mod1Mask, KeyPress, handle_tab_backward, NULL, 0 },
|
||||
{ XK_Tab, ShiftMask | Mod1Mask, KeyPress, handle_tab_backward, NULL, 0 },
|
||||
{ XK_Escape, Mod1Mask, KeyPress, handle_focus_previous, NULL, 0 },
|
||||
{ XK_Left, Mod1Mask, KeyPress, handle_workspace_left, NULL, 0 },
|
||||
{ XK_Right, Mod1Mask, KeyPress, handle_workspace_right, NULL, 0 },
|
||||
{ None, 0, 0, NULL, NULL, 0 }
|
||||
};
|
||||
|
||||
@ -500,19 +510,8 @@ meta_display_process_key_event (MetaDisplay *display,
|
||||
}
|
||||
|
||||
static void
|
||||
handle_activate_workspace (MetaDisplay *display,
|
||||
MetaWindow *event_window,
|
||||
XEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
int which;
|
||||
MetaWorkspace *workspace;
|
||||
|
||||
which = GPOINTER_TO_INT (data);
|
||||
|
||||
workspace = meta_display_get_workspace_by_index (display, which);
|
||||
|
||||
if (workspace)
|
||||
switch_to_workspace (MetaDisplay *display,
|
||||
MetaWorkspace *workspace)
|
||||
{
|
||||
MetaWindow *move_window;
|
||||
|
||||
@ -550,6 +549,86 @@ handle_activate_workspace (MetaDisplay *display,
|
||||
move_window);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_activate_workspace (MetaDisplay *display,
|
||||
MetaWindow *event_window,
|
||||
XEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
int which;
|
||||
MetaWorkspace *workspace;
|
||||
|
||||
which = GPOINTER_TO_INT (data);
|
||||
|
||||
workspace = meta_display_get_workspace_by_index (display, which);
|
||||
|
||||
if (workspace)
|
||||
{
|
||||
switch_to_workspace (display, workspace);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We could offer to create it I suppose */
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_workspace_left (MetaDisplay *display,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
MetaWorkspace *workspace;
|
||||
MetaScreen *screen;
|
||||
int i;
|
||||
|
||||
screen = meta_display_screen_for_root (display,
|
||||
event->xkey.root);
|
||||
|
||||
if (screen == NULL)
|
||||
return;
|
||||
|
||||
i = meta_workspace_index (screen->active_workspace);
|
||||
--i;
|
||||
|
||||
workspace = meta_display_get_workspace_by_index (display, i);
|
||||
|
||||
if (workspace)
|
||||
{
|
||||
switch_to_workspace (display, workspace);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We could offer to create it I suppose */
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_workspace_right (MetaDisplay *display,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
gpointer data)
|
||||
{
|
||||
MetaWorkspace *workspace;
|
||||
MetaScreen *screen;
|
||||
int i;
|
||||
|
||||
screen = meta_display_screen_for_root (display,
|
||||
event->xkey.root);
|
||||
|
||||
if (screen == NULL)
|
||||
return;
|
||||
|
||||
i = meta_workspace_index (screen->active_workspace);
|
||||
++i;
|
||||
|
||||
workspace = meta_display_get_workspace_by_index (display, i);
|
||||
|
||||
if (workspace)
|
||||
{
|
||||
switch_to_workspace (display, workspace);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We could offer to create it I suppose */
|
||||
|
12
src/screen.c
12
src/screen.c
@ -50,7 +50,17 @@ set_wm_check_hint (MetaScreen *screen)
|
||||
XA_WINDOW,
|
||||
32, PropModeReplace, (guchar*) data, 1);
|
||||
|
||||
/* Legacy GNOME hint */
|
||||
/* Legacy GNOME hint (uses cardinal, dunno why) */
|
||||
|
||||
/* legacy hint window should have property containing self */
|
||||
XChangeProperty (screen->display->xdisplay, screen->display->leader_window,
|
||||
screen->display->atom_win_supporting_wm_check,
|
||||
XA_CARDINAL,
|
||||
32, PropModeReplace, (guchar*) data, 1);
|
||||
|
||||
/* do this after setting up window fully, to avoid races
|
||||
* with clients listening to property notify on root.
|
||||
*/
|
||||
XChangeProperty (screen->display->xdisplay, screen->xroot,
|
||||
screen->display->atom_win_supporting_wm_check,
|
||||
XA_CARDINAL,
|
||||
|
Loading…
Reference in New Issue
Block a user