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 ccd7e80a4613edc9948bd7ba43ee10e8ac06e506
Author: Igor <f2...@yandex.ru>
Date:   Tue Oct 25 15:26:02 2016 +0300

    Resolve window manager warning
    
    Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0
---
 terminal/terminal-util.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/terminal/terminal-util.c b/terminal/terminal-util.c
index f851ee9..1e3ff37 100644
--- a/terminal/terminal-util.c
+++ b/terminal/terminal-util.c
@@ -98,27 +98,34 @@ void
 terminal_util_activate_window (GtkWindow *window)
 {
 #ifdef GDK_WINDOWING_X11
+  guint32             timestamp;
   XClientMessageEvent event;
+  GdkWindow          *gdk_window = gtk_widget_get_window (GTK_WIDGET (window));
 
   terminal_return_if_fail (GTK_IS_WINDOW (window));
   terminal_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (window)));
 
-  if (!GDK_IS_X11_WINDOW (gtk_widget_get_window (GTK_WIDGET (window))))
+  if (!GDK_IS_X11_WINDOW (gdk_window))
     return;
 
   /* leave if the window is already active */
   if (gtk_window_is_active (window))
     return;
 
+  timestamp = gtk_get_current_event_time ();
+  if (timestamp == 0)
+    timestamp = gdk_x11_get_server_time (gdk_window);
+
   /* we need a slightly custom version of the call through Gtk+ to
    * properly focus the panel when a plugin calls
    * xfce_panel_plugin_focus_widget() */
   event.type = ClientMessage;
-  event.window = GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window)));
+  event.window = GDK_WINDOW_XID (gdk_window);
   event.message_type = gdk_x11_get_xatom_by_name ("_NET_ACTIVE_WINDOW");
   event.format = 32;
   event.data.l[0] = 1; /* app */
-  event.data.l[1] = event.data.l[2] = event.data.l[3] = event.data.l[4] = 0;
+  event.data.l[1] = timestamp;
+  event.data.l[2] = event.data.l[3] = event.data.l[4] = 0;
 
   gdk_error_trap_push ();
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
https://mail.xfce.org/mailman/listinfo/xfce4-commits

Reply via email to