[Xfce4-commits] [apps/xfce4-screensaver] 01/01: Reduce flicker rate by reducing xkl drawing

noreply at xfce.org noreply at xfce.org
Tue Nov 20 12:56:10 CET 2018


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

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-screensaver.

commit f6d8e56e2d892797f9b34f2696ad334ad94da412
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Tue Nov 20 06:56:05 2018 -0500

    Reduce flicker rate by reducing xkl drawing
---
 src/xfcekbd-indicator-config.c |  3 ---
 src/xfcekbd-indicator.c        | 17 ++++++++++++-----
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/xfcekbd-indicator-config.c b/src/xfcekbd-indicator-config.c
index 300e93e..d795a6b 100644
--- a/src/xfcekbd-indicator-config.c
+++ b/src/xfcekbd-indicator-config.c
@@ -26,9 +26,6 @@
 
 #include <X11/keysym.h>
 
-#include <gdk/gdkx.h>
-#include <pango/pango.h>
-
 #include <libxfce4util/libxfce4util.h>
 #include <xfconf/xfconf.h>
 
diff --git a/src/xfcekbd-indicator.c b/src/xfcekbd-indicator.c
index 1db74f3..9b1e81a 100644
--- a/src/xfcekbd-indicator.c
+++ b/src/xfcekbd-indicator.c
@@ -46,6 +46,8 @@ typedef struct _gki_globals {
     gchar                  **short_group_names;
     GSList                  *widget_instances;
     GSList                  *images;
+
+    gboolean                 redraw_queued;
 } gki_globals;
 
 struct _XfcekbdIndicatorPrivate {
@@ -134,6 +136,7 @@ static gboolean xfcekbd_indicator_key_pressed (GtkWidget        *widget,
         case GDK_KEY_space:
         case GDK_KEY_KP_Space:
             xfcekbd_desktop_config_lock_next_group(&globals.cfg);
+            globals.redraw_queued = TRUE;
             return TRUE;
         default:
             break;
@@ -146,13 +149,10 @@ static gboolean
 xfcekbd_indicator_button_pressed (GtkWidget        *widget,
                                   GdkEventButton   *event,
                                   XfcekbdIndicator *gki) {
-    GtkWidget     *img = gtk_bin_get_child (GTK_BIN (widget));
-    GtkAllocation  allocation;
-    gtk_widget_get_allocation (img, &allocation);
-    xkl_debug (150, "Flag img size %d x %d\n", allocation.width, allocation.height);
     if (event->button == 1 && event->type == GDK_BUTTON_PRESS) {
         xkl_debug (150, "Mouse button pressed on applet\n");
         xfcekbd_desktop_config_lock_next_group (&globals.cfg);
+        globals.redraw_queued = TRUE;
         return TRUE;
     }
     return FALSE;
@@ -447,11 +447,14 @@ static GdkFilterReturn
 xfcekbd_indicator_filter_x_evt (GdkXEvent *xev,
                                 GdkEvent  *event) {
     XEvent *xevent = (XEvent *) xev;
-
+    
     xkl_engine_filter_events (globals.engine, xevent);
     switch (xevent->type) {
         case ReparentNotify:
             {
+                if (!globals.redraw_queued)
+                    return GDK_FILTER_CONTINUE;
+
                 XReparentEvent *rne = (XReparentEvent *) xev;
 
                 ForAllIndicators () {
@@ -469,6 +472,8 @@ xfcekbd_indicator_filter_x_evt (GdkXEvent *xev,
                     }
                 }
                 NextIndicator ()
+
+                globals.redraw_queued = FALSE;
             }
             break;
     }
@@ -600,6 +605,8 @@ xfcekbd_indicator_class_init (XfcekbdIndicatorClass *klass) {
     /* Initing some global vars */
     globals.tooltips_format = "%s";
 
+    globals.redraw_queued = TRUE;
+
     /* Initing vtable */
     object_class->finalize = xfcekbd_indicator_finalize;
 

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


More information about the Xfce4-commits mailing list