[Xfce4-commits] [apps/xfce4-terminal] 01/01: Fix incorrect initial position of a drop-down window under Unity

noreply at xfce.org noreply at xfce.org
Tue Jan 10 10:45:53 CET 2017


This is an automated email from the git hooks/post-receive script.

f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.

commit 68c4e17106e57f1a515b8cb6b9240f57715f0b03
Author: Igor <f2404 at yandex.ru>
Date:   Tue Jan 10 12:45:49 2017 +0300

    Fix incorrect initial position of a drop-down window under Unity
---
 terminal/terminal-window-dropdown.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/terminal/terminal-window-dropdown.c b/terminal/terminal-window-dropdown.c
index 4e08c48..f8ee034 100644
--- a/terminal/terminal-window-dropdown.c
+++ b/terminal/terminal-window-dropdown.c
@@ -707,7 +707,7 @@ terminal_window_dropdown_show (TerminalWindowDropdown *dropdown,
   TerminalWindow    *window = TERMINAL_WINDOW (dropdown);
   gint               w, h;
   GdkRectangle       monitor_geo;
-  gint               x_dest, y_dest;
+  gint               x_dest, y_dest, x_pos, y_pos;
   GtkRequisition     req1;
   gboolean           move_to_active;
   gboolean           keep_above;
@@ -804,12 +804,18 @@ terminal_window_dropdown_show (TerminalWindowDropdown *dropdown,
   x_dest = monitor_geo.x + (monitor_geo.width - w) * dropdown->rel_position;
   y_dest = monitor_geo.y;
 
+  /* move */
+  gtk_window_move (GTK_WINDOW (dropdown), x_dest, y_dest);
+
   /* show window */
   if (!visible)
     gtk_window_present_with_time (GTK_WINDOW (dropdown), timestamp);
 
-  /* move */
-  gtk_window_move (GTK_WINDOW (dropdown), x_dest, y_dest);
+  /* check window position after showing it
+   * https://bugzilla.xfce.org/show_bug.cgi?id=10713 */
+  gtk_window_get_position (GTK_WINDOW (dropdown), &x_pos, &y_pos);
+  if (x_pos != x_dest || y_pos != y_dest)
+    gtk_window_move (GTK_WINDOW (dropdown), x_dest, y_dest);
 
   /* force focus to the window */
   terminal_util_activate_window (GTK_WINDOW (dropdown));

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list