diff options
author | Callum McKenzie <callum@src.gnome.org> | 2009-02-02 08:05:20 +0000 |
---|---|---|
committer | Callum McKenzie <callum@src.gnome.org> | 2009-02-02 08:05:20 +0000 |
commit | ff5d6af1357d15b6658d81ad5d9e9f01f846cb23 (patch) | |
tree | 0c4ce0abc1678b4aaa64ca8ec96e1edee823bab4 /mixer | |
parent | daeb9aa088ccf4b709a2c843033e5b25dadaccbd (diff) |
Popdown the volume control dock when it looses focus.
svn path=/trunk/; revision=11238
Diffstat (limited to 'mixer')
-rw-r--r-- | mixer/ChangeLog | 11 | ||||
-rw-r--r-- | mixer/applet.c | 16 | ||||
-rw-r--r-- | mixer/dock.c | 14 |
3 files changed, 33 insertions, 8 deletions
diff --git a/mixer/ChangeLog b/mixer/ChangeLog index b19142314..b93f7d2d6 100644 --- a/mixer/ChangeLog +++ b/mixer/ChangeLog @@ -1,3 +1,14 @@ +2009-02-02 Callum McKenzie <callum@spooky-possum.org> + + * applet.c: + * dock.c: Make the dock popdown when it looses focus. + +2009-02-01 Callum McKenzie <callum@spooky-possum.org> + + * dock.c: + * applet.c: Always make the dock horizontal since there doesn't + appear to be an easy way to rotate the mute check-box. + 2009-01-31 Mario Blättermann <mariobl@svngnome.org> * docs/de/de.po: Small fix in German translation diff --git a/mixer/applet.c b/mixer/applet.c index 7c41e622a..56eba79d9 100644 --- a/mixer/applet.c +++ b/mixer/applet.c @@ -884,6 +884,15 @@ gnome_volume_applet_key (GtkWidget *widget, return GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event); } +static gboolean +gnome_volume_applet_dock_focus_out (GtkWidget *dock, GdkEventFocus *event, + GnomeVolumeApplet *applet) +{ + gnome_volume_applet_popdown_dock (applet); + + return FALSE; +} + /* * Change orientation or size of panel. */ @@ -898,9 +907,12 @@ gnome_volume_applet_orientation (PanelApplet *_applet, if (applet->dock) { gtk_widget_destroy (GTK_WIDGET (applet->dock)); } - dock = gnome_volume_applet_dock_new (IS_PANEL_HORIZONTAL (orientation) ? - GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL, + dock = gnome_volume_applet_dock_new (GTK_ORIENTATION_VERTICAL, applet); + gtk_widget_add_events (dock, GDK_FOCUS_CHANGE_MASK); + g_signal_connect (G_OBJECT (dock), "focus-out-event", + G_CALLBACK (gnome_volume_applet_dock_focus_out), + applet); applet->dock = GNOME_VOLUME_APPLET_DOCK (dock); gnome_volume_applet_dock_change (applet->dock, applet->adjustment); diff --git a/mixer/dock.c b/mixer/dock.c index dec14183a..e6f8aa12d 100644 --- a/mixer/dock.c +++ b/mixer/dock.c @@ -60,13 +60,13 @@ gnome_volume_applet_dock_init (GnomeVolumeAppletDock *dock) dock->orientation = -1; dock->timeout = 0; -#if 0 +#if 1 /* We can't use a simple GDK_WINDOW_TYPE_HINT_DOCK here since * the dock windows don't accept input by default. Instead we use * the popup menu type. In the end we set everything by hand anyway * since what happens depends very heavily on the window manager. */ - gtk_window_set_type_hint (GTK_WINDOW (dock), - GDK_WINDOW_TYPE_HINT_POPUP_MENU); +// gtk_window_set_type_hint (GTK_WINDOW (dock), +// GDK_WINDOW_TYPE_HINT_POPUP_MENU); gtk_window_set_keep_above (GTK_WINDOW (dock), TRUE); gtk_window_set_decorated (GTK_WINDOW (dock), FALSE); gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dock), TRUE); @@ -104,7 +104,11 @@ GtkWidget * gnome_volume_applet_dock_new (GtkOrientation orientation, GnomeVolumeApplet *parent) { - GtkWidget *button, *scale, *mute, *more; + /* FIXME: Remove the orientation argument, or fix it for vertical + boxes (a "horizontal" orientation - the meaning is reversed for + historical reasons. */ + + GtkWidget *button, *scale, *mute, *more, *label; GtkWidget *container, *outerline, *innerline, *frame; GnomeVolumeAppletDock *dock; gint i; @@ -121,8 +125,6 @@ gnome_volume_applet_dock_new (GtkOrientation orientation, dock = g_object_new (GNOME_VOLUME_APPLET_TYPE_DOCK, NULL); - gtk_window_set_type_hint (GTK_WINDOW (dock), - GDK_WINDOW_TYPE_HINT_DOCK); dock->orientation = orientation; dock->model = parent; |