diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2022-02-11 13:51:18 +0100 |
---|---|---|
committer | TheJackiMonster <thejackimonster@gmail.com> | 2022-02-11 13:51:18 +0100 |
commit | 42e5473c0c1d82ffa161b928f25c1461de16c2b3 (patch) | |
tree | 7690e6844e2e29098ef6dd4acaf930bd89ab2543 | |
parent | 098b9d48733cf2374e4c1c6f4d9ec733edfe59d5 (diff) | |
download | messenger-gtk-42e5473c0c1d82ffa161b928f25c1461de16c2b3.tar.gz messenger-gtk-42e5473c0c1d82ffa161b928f25c1461de16c2b3.zip |
Add workaround for HdyFlap switching focus on touch devices
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r-- | src/ui/chat.c | 21 | ||||
-rw-r--r-- | src/ui/messenger.c | 14 |
2 files changed, 26 insertions, 9 deletions
diff --git a/src/ui/chat.c b/src/ui/chat.c index 03af9d0..bf5085c 100644 --- a/src/ui/chat.c +++ b/src/ui/chat.c | |||
@@ -35,16 +35,25 @@ | |||
35 | #include "../application.h" | 35 | #include "../application.h" |
36 | #include "../contact.h" | 36 | #include "../contact.h" |
37 | 37 | ||
38 | static void | 38 | static gboolean |
39 | handle_flap_via_button_click(UNUSED GtkButton *button, | 39 | _flap_reveal_switch(gpointer user_data) |
40 | gpointer user_data) | ||
41 | { | 40 | { |
42 | HdyFlap *flap = HDY_FLAP(user_data); | 41 | HdyFlap* flap = HDY_FLAP(user_data); |
43 | 42 | ||
44 | if (TRUE == hdy_flap_get_reveal_flap(flap)) | 43 | if (TRUE == hdy_flap_get_reveal_flap(flap)) { |
45 | hdy_flap_set_reveal_flap(flap, FALSE); | 44 | hdy_flap_set_reveal_flap(flap, FALSE); |
46 | else | 45 | } else { |
47 | hdy_flap_set_reveal_flap(flap, TRUE); | 46 | hdy_flap_set_reveal_flap(flap, TRUE); |
47 | } | ||
48 | |||
49 | return FALSE; | ||
50 | } | ||
51 | |||
52 | static void | ||
53 | handle_flap_via_button_click(UNUSED GtkButton* button, | ||
54 | gpointer user_data) | ||
55 | { | ||
56 | g_idle_add(G_SOURCE_FUNC(_flap_reveal_switch), user_data); | ||
48 | } | 57 | } |
49 | 58 | ||
50 | static void | 59 | static void |
diff --git a/src/ui/messenger.c b/src/ui/messenger.c index 7a2ddff..7fdb60e 100644 --- a/src/ui/messenger.c +++ b/src/ui/messenger.c | |||
@@ -35,9 +35,8 @@ | |||
35 | 35 | ||
36 | #include "../application.h" | 36 | #include "../application.h" |
37 | 37 | ||
38 | static void | 38 | static gboolean |
39 | handle_flap_via_button_click(UNUSED GtkButton* button, | 39 | _flap_reveal_switch(gpointer user_data) |
40 | gpointer user_data) | ||
41 | { | 40 | { |
42 | HdyFlap* flap = HDY_FLAP(user_data); | 41 | HdyFlap* flap = HDY_FLAP(user_data); |
43 | 42 | ||
@@ -46,6 +45,15 @@ handle_flap_via_button_click(UNUSED GtkButton* button, | |||
46 | } else { | 45 | } else { |
47 | hdy_flap_set_reveal_flap(flap, TRUE); | 46 | hdy_flap_set_reveal_flap(flap, TRUE); |
48 | } | 47 | } |
48 | |||
49 | return FALSE; | ||
50 | } | ||
51 | |||
52 | static void | ||
53 | handle_flap_via_button_click(UNUSED GtkButton* button, | ||
54 | gpointer user_data) | ||
55 | { | ||
56 | g_idle_add(G_SOURCE_FUNC(_flap_reveal_switch), user_data); | ||
49 | } | 57 | } |
50 | 58 | ||
51 | static void | 59 | static void |