aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorSteve Frécinaux <code@istique.net>2009-09-15 02:31:23 +0800
committerSteve Frécinaux <code@istique.net>2009-09-15 03:05:40 +0800
commitff5b9397a4a2ca0e1b918b196cc14f9c6634d013 (patch)
tree754e31c0e48ba2b382fc02ba8a77c4196f86f2db /libempathy-gtk
parent590428c77768377bcc5678364380b136fda96f35 (diff)
downloadgsoc2013-empathy-ff5b9397a4a2ca0e1b918b196cc14f9c6634d013.tar
gsoc2013-empathy-ff5b9397a4a2ca0e1b918b196cc14f9c6634d013.tar.gz
gsoc2013-empathy-ff5b9397a4a2ca0e1b918b196cc14f9c6634d013.tar.bz2
gsoc2013-empathy-ff5b9397a4a2ca0e1b918b196cc14f9c6634d013.tar.lz
gsoc2013-empathy-ff5b9397a4a2ca0e1b918b196cc14f9c6634d013.tar.xz
gsoc2013-empathy-ff5b9397a4a2ca0e1b918b196cc14f9c6634d013.tar.zst
gsoc2013-empathy-ff5b9397a4a2ca0e1b918b196cc14f9c6634d013.zip
Ensure the Contact List is moved to the current workspace when shown.
The new metacity/mutter 2.27 only moves windows to current workspace on present() when the window is a dialog. The Contact List isn't one, so we try to be smart and move explicitely the window's toplevel GdkWindow on the current workspace before trying to present it. This has been tested successfully with mutter 2.27 and metacity 2.26. This fixes Bug 593883 - Empathy misbehaviour within gnome-shell.
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-ui-utils.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 1b02195d2..3cf754f84 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -1295,17 +1295,15 @@ empathy_window_present (GtkWindow *window,
gboolean steal_focus)
{
guint32 timestamp;
+ GdkWindow *window;
g_return_if_fail (GTK_IS_WINDOW (window));
- /* There are three cases: hidden, visible, visible on another
- * workspace.
- */
-
- if (!empathy_window_get_is_visible (window)) {
- /* Hide it so present brings it to the current workspace. */
- gtk_widget_hide (GTK_WIDGET (window));
- }
+ /* Move the window to the current workspace before trying to show it.
+ * This is the behaviour people expect when clicking on the statusbar icon. */
+ window = gtk_widget_get_window (GTK_WIDGET (window));
+ if (window)
+ gdk_x11_window_move_to_current_desktop (window);
timestamp = gtk_get_current_event_time ();
gtk_window_present_with_time (window, timestamp);