aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-ui-utils.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2009-11-23 21:31:30 +0800
committerXavier Claessens <xclaesse@gmail.com>2009-11-24 00:04:28 +0800
commit18f7718773d305ea2c83918c82ea938e2ff55ef3 (patch)
tree0fb041fbad1b9b016bc2a822bb08691f750b9039 /libempathy-gtk/empathy-ui-utils.c
parent05ecb3d3c81446517a71eaa884076efb9d3ae35a (diff)
downloadgsoc2013-empathy-18f7718773d305ea2c83918c82ea938e2ff55ef3.tar
gsoc2013-empathy-18f7718773d305ea2c83918c82ea938e2ff55ef3.tar.gz
gsoc2013-empathy-18f7718773d305ea2c83918c82ea938e2ff55ef3.tar.bz2
gsoc2013-empathy-18f7718773d305ea2c83918c82ea938e2ff55ef3.tar.lz
gsoc2013-empathy-18f7718773d305ea2c83918c82ea938e2ff55ef3.tar.xz
gsoc2013-empathy-18f7718773d305ea2c83918c82ea938e2ff55ef3.tar.zst
gsoc2013-empathy-18f7718773d305ea2c83918c82ea938e2ff55ef3.zip
Make empathy_present_window() also move to current desktop with compiz. Fixes bug #602649
Diffstat (limited to 'libempathy-gtk/empathy-ui-utils.c')
-rw-r--r--libempathy-gtk/empathy-ui-utils.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 523b89351..be6aaa249 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -1302,14 +1302,26 @@ empathy_window_present (GtkWindow *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. */
gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
- if (gdk_window)
+ if (gdk_window) {
+ gint x, y;
+ gint w, h;
+
+ /* Has no effect if the WM has viewports, like compiz */
gdk_x11_window_move_to_current_desktop (gdk_window);
+ /* If window is still off-screen, hide it to force it to
+ * reposition on the current workspace. */
+ gtk_window_get_position (window, &x, &y);
+ gtk_window_get_size (window, &w, &h);
+ if (x + w < 0 || y + h < 0 ||
+ x > gdk_screen_width () ||
+ y > gdk_screen_height ())
+ gtk_widget_hide (GTK_WIDGET (window));
+ }
+
timestamp = gtk_get_current_event_time ();
gtk_window_present_with_time (window, timestamp);
gtk_window_set_skip_taskbar_hint (window, FALSE);
- /* FIXME: This shouldn't be required as gtk_window_present's doc says
- * it deiconify automatically. */
gtk_window_deiconify (window);
}