1
0
Fork 0

raise/focus windows on left-click, seem to have broken that yesterday

2001-10-14  Havoc Pennington  <hp@pobox.com>

	* src/frames.c (meta_frames_button_press_event): raise/focus
	windows on left-click, seem to have broken that yesterday

	* src/keybindings.c, src/display.c, src/window.c: add keybinding
	to show/hide all normal windows (so you can see the desktop).
	Currently Ctrl+Alt+D, which I don't like, but yay.
This commit is contained in:
Havoc Pennington 2001-10-15 03:39:41 +00:00 committed by Havoc Pennington
parent 842eb3fa93
commit a29c93a95a
8 changed files with 102 additions and 9 deletions

View file

@ -1,3 +1,12 @@
2001-10-14 Havoc Pennington <hp@pobox.com>
* src/frames.c (meta_frames_button_press_event): raise/focus
windows on left-click, seem to have broken that yesterday
* src/keybindings.c, src/display.c, src/window.c: add keybinding
to show/hide all normal windows (so you can see the desktop).
Currently Ctrl+Alt+D, which I don't like, but yay.
2001-10-14 Havoc Pennington <hp@pobox.com>
* src/window.c (meta_window_new): take a window mapped at

1
README
View file

@ -49,6 +49,7 @@ METACITY FEATURES
Alt-Escape focus previous window
Alt-Left Arrow previous workspace
Alt-Right Arrow next workspace
Ctrl-Alt-D minimize/unminimize all, to show desktop
- Window keybindings:
Alt-space window menu

View file

@ -172,6 +172,8 @@ meta_display_open (const char *name)
display->focus_window = NULL;
display->prev_focus_window = NULL;
display->showing_desktop = FALSE;
/* we have to go ahead and do this so error handlers work */
all_displays = g_slist_prepend (all_displays, display);
@ -1722,3 +1724,45 @@ meta_display_update_active_window_hint (MetaDisplay *display)
tmp = tmp->next;
}
}
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);
}
void
meta_display_unshow_desktop (MetaDisplay *display)
{
if (!display->showing_desktop)
return;
display->showing_desktop = FALSE;
queue_windows_showing (display);
}

View file

@ -111,6 +111,8 @@ struct _MetaDisplay
MetaWindow *prev_focus_window;
GList *workspaces;
guint showing_desktop : 1;
/*< private-ish >*/
MetaEventQueue *events;
@ -197,4 +199,8 @@ 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);
#endif

View file

@ -1025,6 +1025,15 @@ meta_frames_button_press_event (GtkWidget *widget,
if (control == META_FRAME_CONTROL_CLIENT_AREA)
return FALSE; /* not on the frame, just passed through from client */
if (event->button == 1)
{
meta_core_user_raise (gdk_display,
frame->xwindow);
meta_core_user_focus (gdk_display,
frame->xwindow,
event->time);
}
/* We want to shade even if we have a GrabOp, since we'll have a move grab
* if we double click the titlebar.

View file

@ -61,11 +61,16 @@ 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);
static void handle_workspace_right (MetaDisplay *display,
MetaWindow *window,
XEvent *event,
gpointer data);
static void handle_toggle_desktop (MetaDisplay *display,
MetaWindow *window,
XEvent *event,
gpointer data);
static gboolean process_keyboard_move_grab (MetaDisplay *display,
MetaWindow *window,
XEvent *event,
@ -110,6 +115,8 @@ static MetaKeyBinding screen_bindings[] = {
{ 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 },
/* I don't like this binding, but haven't picked the right one yet */
{ XK_d, Mod1Mask | ControlMask, KeyPress, handle_toggle_desktop, NULL, 0 },
{ None, 0, 0, NULL, NULL, 0 }
};
@ -867,6 +874,18 @@ handle_workspace_right (MetaDisplay *display,
}
}
static void
handle_toggle_desktop (MetaDisplay *display,
MetaWindow *window,
XEvent *event,
gpointer data)
{
if (display->showing_desktop)
meta_display_unshow_desktop (display);
else
meta_display_show_desktop (display);
}
static void
handle_activate_menu (MetaDisplay *display,
MetaWindow *event_window,

View file

@ -1,5 +0,0 @@
Makefile.in
Makefile
.libs
.deps
metacity-uislave

View file

@ -814,6 +814,16 @@ meta_window_calc_showing (MetaWindow *window)
on_workspace = TRUE;
meta_verbose ("Window %s is on all workspaces\n", window->desc);
}
if (on_workspace &&
window->display->showing_desktop &&
window->type != META_WINDOW_DESKTOP &&
window->type != META_WINDOW_DOCK)
{
meta_verbose ("Window %s is on current workspace, but we're showing the desktop\n",
window->desc);
on_workspace = FALSE;
}
if (window->minimized || !on_workspace)
{