summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2001-10-15 03:39:41 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-10-15 03:39:41 +0000
commita29c93a95a94a3da8f03d727e5b77848ae673292 (patch)
tree2f9ea39e27509beaf2b74f99dd5192b62c99978f
parent842eb3fa9312d21402e61133f1d29bfc7a653ed1 (diff)
downloadmetacity-a29c93a95a94a3da8f03d727e5b77848ae673292.tar.gz
metacity-a29c93a95a94a3da8f03d727e5b77848ae673292.tar.bz2
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.
-rw-r--r--ChangeLog9
-rw-r--r--README1
-rw-r--r--src/display.c44
-rw-r--r--src/display.h6
-rw-r--r--src/frames.c9
-rw-r--r--src/keybindings.c27
-rw-r--r--src/uislave/.cvsignore5
-rw-r--r--src/window.c10
8 files changed, 102 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index b746cc1..47bc226 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
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
fullscreen size/pos to desire maximization; once I add a
fullscreen state, will change to copy kwin and take this mapping
diff --git a/README b/README
index 75cd16b..cb3a7a2 100644
--- a/README
+++ b/README
@@ -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
diff --git a/src/display.c b/src/display.c
index de548c7..482754f 100644
--- a/src/display.c
+++ b/src/display.c
@@ -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);
+}
diff --git a/src/display.h b/src/display.h
index fe2a9e6..80072c2 100644
--- a/src/display.h
+++ b/src/display.h
@@ -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
diff --git a/src/frames.c b/src/frames.c
index 7e1c38b..59ef40c 100644
--- a/src/frames.c
+++ b/src/frames.c
@@ -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.
diff --git a/src/keybindings.c b/src/keybindings.c
index bf72f6d..6417ed8 100644
--- a/src/keybindings.c
+++ b/src/keybindings.c
@@ -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 }
};
@@ -868,6 +875,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,
XEvent *event,
diff --git a/src/uislave/.cvsignore b/src/uislave/.cvsignore
deleted file mode 100644
index 603f53e..0000000
--- a/src/uislave/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-Makefile.in
-Makefile
-.libs
-.deps
-metacity-uislave
diff --git a/src/window.c b/src/window.c
index fdd0440..ab642da 100644
--- a/src/window.c
+++ b/src/window.c
@@ -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)
{