[Xfce4-commits] [apps/xfce4-terminal] 01/01: Use gdk_window_is_visible function to check if drop-down window is visible
noreply at xfce.org
noreply at xfce.org
Mon Oct 24 15:24:56 CEST 2016
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 f778632fe4ea3c7483f2bff2ba3f619bae48f286
Author: Igor <f2404 at yandex.ru>
Date: Mon Oct 24 16:23:39 2016 +0300
Use gdk_window_is_visible function to check if drop-down window is visible
gtk_widget_get_visible seems to show false-positive results.
Might fix https://bugzilla.xfce.org/show_bug.cgi?id=12917
---
terminal/terminal-window-dropdown.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/terminal/terminal-window-dropdown.c b/terminal/terminal-window-dropdown.c
index 3f68910..9383509 100644
--- a/terminal/terminal-window-dropdown.c
+++ b/terminal/terminal-window-dropdown.c
@@ -511,7 +511,7 @@ terminal_window_dropdown_status_icon_press_event (GtkStatusIcon *status
if (event->button == 3)
return FALSE;
- if (gtk_widget_get_visible (GTK_WIDGET (dropdown)))
+ if (gdk_window_is_visible (gtk_widget_get_window (GTK_WIDGET (dropdown))))
terminal_window_dropdown_hide (dropdown);
else
terminal_window_dropdown_show (dropdown, event->time);
@@ -729,7 +729,7 @@ terminal_window_dropdown_show (TerminalWindowDropdown *dropdown,
GdkMonitor *monitor;
#endif
- visible = gtk_widget_get_visible (GTK_WIDGET (dropdown));
+ visible = gdk_window_is_visible (gtk_widget_get_window (GTK_WIDGET (dropdown)));
if (dropdown->animation_timeout_id != 0)
{
@@ -805,7 +805,8 @@ terminal_window_dropdown_show (TerminalWindowDropdown *dropdown,
y_dest = monitor_geo.y;
/* show window */
- gtk_window_present_with_time (GTK_WINDOW (dropdown), timestamp);
+ if (!visible)
+ gtk_window_present_with_time (GTK_WINDOW (dropdown), timestamp);
/* move */
gtk_window_move (GTK_WINDOW (dropdown), x_dest, y_dest);
@@ -845,7 +846,7 @@ terminal_window_dropdown_toggle_real (TerminalWindowDropdown *dropdown,
gboolean toggle_focus;
if (!force_show
- && gtk_widget_get_visible (GTK_WIDGET (dropdown))
+ && gdk_window_is_visible (gtk_widget_get_window (GTK_WIDGET (dropdown)))
&& dropdown->animation_dir != ANIMATION_DIR_UP)
{
g_object_get (G_OBJECT (window->preferences), "dropdown-toggle-focus", &toggle_focus, NULL);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list