summaryrefslogtreecommitdiffstats
path: root/meta/recipes-gnome/gtk+/gtk+-2.24.22/0001-GtkButton-do-not-prelight-in-touchscreen-mode.patch
blob: 71e334d8971779e32ae56b2ff17590526f026411 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From d1f7a894674dfdd6769f1bbae31eb1a69e451a5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
Date: Fri, 16 Nov 2012 22:07:28 +0100
Subject: [PATCH] GtkButton: do not prelight in touchscreen mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Code was copied from GtkToggleButton.

Upstream-Status: submitted [1]

[1] https://bugzilla.gnome.org/show_bug.cgi?id=689138

From d1f7a894674dfdd6769f1bbae31eb1a69e451a5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
Date: Fri, 16 Nov 2012 22:07:28 +0100
Subject: [PATCH] GtkButton: do not prelight in touchscreen mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Code was copied from GtkToggleButton.

Upstream-Status: submitted [1]

[1] https://bugzilla.gnome.org/show_bug.cgi?id=689138

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
 gtk/gtkbutton.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index f472007..1beb1b6 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -2079,15 +2079,19 @@ _gtk_button_set_depressed (GtkButton *button,
 static void
 gtk_button_update_state (GtkButton *button)
 {
-  gboolean depressed;
+  gboolean depressed, touchscreen;
   GtkStateType new_state;
 
+  g_object_get (gtk_widget_get_settings (GTK_WIDGET (button)),
+                "gtk-touchscreen-mode", &touchscreen,
+                NULL);
+
   if (button->activate_timeout)
     depressed = button->depress_on_activate;
   else
     depressed = button->in_button && button->button_down;
 
-  if (button->in_button && (!button->button_down || !depressed))
+  if (!touchscreen && button->in_button && (!button->button_down || !depressed))
     new_state = GTK_STATE_PRELIGHT;
   else
     new_state = depressed ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL;
-- 
1.7.6.5