[gnome-applets] Store GtkWidget * window in a variable as it's called multiple times
- From: Andre Klapper <aklapper src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets] Store GtkWidget * window in a variable as it's called multiple times
- Date: Fri, 23 Apr 2010 15:14:49 +0000 (UTC)
commit 20e038c79f8557612eab3ea3edbaf23ec9390654
Author: Andre Klapper <a9016009 gmx de>
Date: Fri Apr 23 16:58:25 2010 +0200
Store GtkWidget * window in a variable as it's called multiple times
accessx-status/applet.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/accessx-status/applet.c b/accessx-status/applet.c
index ec62f02..f8a5081 100644
--- a/accessx-status/applet.c
+++ b/accessx-status/applet.c
@@ -618,16 +618,20 @@ accessx_status_applet_update (AccessxStatusApplet *sapplet,
AccessxStatusNotifyType notify_type,
XkbEvent *event)
{
+ GtkWindow * window;
gint i;
+
+ window = gtk_widget_get_window (GTK_WIDGET (sapplet->applet));
+
if (notify_type & ACCESSX_STATUS_MODIFIERS) {
unsigned int locked_mods = 0, latched_mods = 0;
if (event != NULL) {
locked_mods = event->state.locked_mods;
latched_mods = event->state.latched_mods;
}
- else if (sapplet->applet && gtk_widget_get_window (GTK_WIDGET (sapplet->applet))) {
+ else if (sapplet->applet && window) {
XkbStateRec state;
- XkbGetState (GDK_WINDOW_XDISPLAY (gtk_widget_get_window (GTK_WIDGET (sapplet->applet))),
+ XkbGetState (GDK_WINDOW_XDISPLAY (window),
XkbUseCoreKbd, &state);
locked_mods = state.locked_mods;
latched_mods = state.latched_mods;
@@ -670,7 +674,7 @@ accessx_status_applet_update (AccessxStatusApplet *sapplet,
if (notify_type & ACCESSX_STATUS_ENABLED) {
/* Update the visibility of widgets in the box */
- XkbGetControls (GDK_WINDOW_XDISPLAY (gtk_widget_get_window (GTK_WIDGET (sapplet->applet))),
+ XkbGetControls (GDK_WINDOW_XDISPLAY (window),
/* XkbMouseKeysMask | XkbStickyKeysMask |
XkbSlowKeysMask | XkbBounceKeysMask, */
XkbAllControlsMask,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]