messenger-gtk

Gtk+3 graphical user interfaces for GNUnet Messenger
Log | Files | Refs | Submodules | README | LICENSE

commit 42e5473c0c1d82ffa161b928f25c1461de16c2b3
parent 098b9d48733cf2374e4c1c6f4d9ec733edfe59d5
Author: TheJackiMonster <thejackimonster@gmail.com>
Date:   Fri, 11 Feb 2022 13:51:18 +0100

Add workaround for HdyFlap switching focus on touch devices

Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>

Diffstat:
Msrc/ui/chat.c | 21+++++++++++++++------
Msrc/ui/messenger.c | 14+++++++++++---
2 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/src/ui/chat.c b/src/ui/chat.c @@ -35,16 +35,25 @@ #include "../application.h" #include "../contact.h" -static void -handle_flap_via_button_click(UNUSED GtkButton *button, - gpointer user_data) +static gboolean +_flap_reveal_switch(gpointer user_data) { - HdyFlap *flap = HDY_FLAP(user_data); + HdyFlap* flap = HDY_FLAP(user_data); - if (TRUE == hdy_flap_get_reveal_flap(flap)) + if (TRUE == hdy_flap_get_reveal_flap(flap)) { hdy_flap_set_reveal_flap(flap, FALSE); - else + } else { hdy_flap_set_reveal_flap(flap, TRUE); + } + + return FALSE; +} + +static void +handle_flap_via_button_click(UNUSED GtkButton* button, + gpointer user_data) +{ + g_idle_add(G_SOURCE_FUNC(_flap_reveal_switch), user_data); } static void diff --git a/src/ui/messenger.c b/src/ui/messenger.c @@ -35,9 +35,8 @@ #include "../application.h" -static void -handle_flap_via_button_click(UNUSED GtkButton* button, - gpointer user_data) +static gboolean +_flap_reveal_switch(gpointer user_data) { HdyFlap* flap = HDY_FLAP(user_data); @@ -46,6 +45,15 @@ handle_flap_via_button_click(UNUSED GtkButton* button, } else { hdy_flap_set_reveal_flap(flap, TRUE); } + + return FALSE; +} + +static void +handle_flap_via_button_click(UNUSED GtkButton* button, + gpointer user_data) +{ + g_idle_add(G_SOURCE_FUNC(_flap_reveal_switch), user_data); } static void