diff --git a/patches_sylpheed/0014-Fix-conflicting-and-broken-hotkeys.patch b/patches_sylpheed/0014-Fix-conflicting-and-broken-hotkeys.patch index ca0f592..89d2064 100644 --- a/patches_sylpheed/0014-Fix-conflicting-and-broken-hotkeys.patch +++ b/patches_sylpheed/0014-Fix-conflicting-and-broken-hotkeys.patch @@ -1,15 +1,15 @@ -From 27c9bb71055ca268813bdece9b2f9a2e558b1350 Mon Sep 17 00:00:00 2001 +From 1899c2c910fa98c5218101c407d3ed8cf1b24a74 Mon Sep 17 00:00:00 2001 From: Peter Zhigalov Date: Sat, 18 Jun 2022 04:47:15 +0700 Subject: [PATCH 14/19] Fix conflicting and broken hotkeys --- - src/addressbook.c | 56 +++++++++++++++++++++++++ - src/compose.c | 28 +++++++++++-- - src/gtkutils.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++ - src/gtkutils.h | 9 ++++ - src/mainwindow.c | 44 ++++++++++++++++++-- - 5 files changed, 234 insertions(+), 7 deletions(-) + src/addressbook.c | 56 +++++++++++++++++++ + src/compose.c | 28 ++++++++-- + src/gtkutils.c | 139 ++++++++++++++++++++++++++++++++++++++++++++++ + src/gtkutils.h | 10 ++++ + src/mainwindow.c | 44 ++++++++++++++- + 5 files changed, 270 insertions(+), 7 deletions(-) diff --git a/src/addressbook.c b/src/addressbook.c index e2768b4..ffa0a26 100644 @@ -211,10 +211,10 @@ index a927b00..ec7c818 100644 static void compose_grab_focus_cb(GtkWidget *widget, Compose *compose) diff --git a/src/gtkutils.c b/src/gtkutils.c -index b1a488a..5f49969 100644 +index b1a488a..33db071 100644 --- a/src/gtkutils.c +++ b/src/gtkutils.c -@@ -1117,3 +1117,107 @@ void gtkut_events_flush(void) +@@ -1117,3 +1117,142 @@ void gtkut_events_flush(void) { GTK_EVENTS_FLUSH(); } @@ -247,6 +247,41 @@ index b1a488a..5f49969 100644 + return NULL; +} + ++static void gtkut_get_selected_cb(GtkWidget *widget, gpointer data) ++{ ++ GtkWidget **selected = (GtkWidget **)data; ++ gint start = 0, end = 0; ++ ++ if (!widget || !selected) ++ return; ++ ++ if (GTK_IS_CONTAINER(widget)) ++ gtk_container_foreach(GTK_CONTAINER(widget), gtkut_get_selected_cb, data); ++ ++ if (*selected) ++ return; ++ ++ if (GTK_IS_LABEL(widget) && ++ gtk_label_get_selectable(GTK_LABEL(widget)) && ++ gtk_label_get_selection_bounds(GTK_LABEL(widget), &start, &end)) { ++ *selected = widget; ++ } ++} ++ ++GtkWidget *gtkut_get_selected_widget(void) ++{ ++ GtkWindow *window = gtkut_get_active_window(); ++ if (window) { ++ GtkWidget *selected = NULL; ++ gtk_container_foreach(GTK_CONTAINER(window), gtkut_get_selected_cb, &selected); ++ if (selected) { ++ return selected; ++ } ++ return gtkut_get_focus_widget(); ++ } ++ return NULL; ++} ++ +gboolean gtkut_is_active_window(GtkWindow *window) +{ + GtkWindow *active_window = gtkut_get_active_window(); @@ -261,7 +296,7 @@ index b1a488a..5f49969 100644 + +gboolean gtkut_default_cut(void) +{ -+ GtkWidget *focus_widget = gtkut_get_focus_widget(); ++ GtkWidget *focus_widget = gtkut_get_selected_widget(); + if (focus_widget) { + if (GTK_IS_LABEL(focus_widget) && + gtk_label_get_selectable(GTK_LABEL(focus_widget))) { @@ -278,7 +313,7 @@ index b1a488a..5f49969 100644 + +gboolean gtkut_default_copy(void) +{ -+ GtkWidget *focus_widget = gtkut_get_focus_widget(); ++ GtkWidget *focus_widget = gtkut_get_selected_widget(); + if (focus_widget) { + if ((GTK_IS_LABEL(focus_widget) && + gtk_label_get_selectable(GTK_LABEL(focus_widget))) || @@ -323,15 +358,16 @@ index b1a488a..5f49969 100644 + return FALSE; +} diff --git a/src/gtkutils.h b/src/gtkutils.h -index 1872e67..a47f56d 100644 +index 1872e67..0434c2e 100644 --- a/src/gtkutils.h +++ b/src/gtkutils.h -@@ -235,4 +235,13 @@ void gtkut_widget_init (void); +@@ -235,4 +235,14 @@ void gtkut_widget_init (void); void gtkut_events_flush (void); +GtkWindow *gtkut_get_active_window (void); +GtkWidget *gtkut_get_focus_widget (void); ++GtkWidget *gtkut_get_selected_widget (void); +gboolean gtkut_is_active_window (GtkWindow *window); + +gboolean gtkut_default_cut (void); @@ -444,5 +480,5 @@ index 1dc54d1..1ed206c 100644 summary_select_all(mainwin->summaryview); else if (GTK_WIDGET_HAS_FOCUS(mainwin->summaryview->qsearch->entry)) -- -2.37.1 (Apple Git-137.1) +2.39.3 (Apple Git-145) diff --git a/patches_sylpheed/0016-Improve-UX-for-macOS-builds.patch b/patches_sylpheed/0016-Improve-UX-for-macOS-builds.patch index eb5a24d..ba7cac3 100644 --- a/patches_sylpheed/0016-Improve-UX-for-macOS-builds.patch +++ b/patches_sylpheed/0016-Improve-UX-for-macOS-builds.patch @@ -1,4 +1,4 @@ -From fff7a8f7877202431030fb9844c00c3949a985e0 Mon Sep 17 00:00:00 2001 +From 7eef8906b0b0e10e23bdf042d059ebd0576f6a4e Mon Sep 17 00:00:00 2001 From: Peter Zhigalov Date: Sat, 16 Jul 2022 03:07:10 +0700 Subject: [PATCH 16/19] Improve UX for macOS builds @@ -73,7 +73,7 @@ index 2fab74d..555adf7 100644 libsylpheed-plugin-0.la \ ../libsylph/libsylph-0.la \ diff --git a/src/gtkutils.c b/src/gtkutils.c -index 5f49969..3e53130 100644 +index 33db071..7d6a2f1 100644 --- a/src/gtkutils.c +++ b/src/gtkutils.c @@ -34,6 +34,10 @@ @@ -220,5 +220,5 @@ index 7c8788f..3ccfcbd 100644 static GtkWidget *prefs_other_create(void) -- -2.37.1 (Apple Git-137.1) +2.39.3 (Apple Git-145) diff --git a/patches_sylpheed/0020-Allow-focus-for-selectable-labels-on-macOS.patch b/patches_sylpheed/0020-Allow-focus-for-selectable-labels-on-macOS.patch deleted file mode 100644 index 49f885b..0000000 --- a/patches_sylpheed/0020-Allow-focus-for-selectable-labels-on-macOS.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 6f66378f75b6192ce439bcb583195bcc37779d00 Mon Sep 17 00:00:00 2001 -From: Peter Zhigalov -Date: Sun, 4 Feb 2024 02:38:19 +0700 -Subject: [PATCH 20/20] Allow focus for selectable labels on macOS - ---- - src/alertpanel.c | 2 ++ - src/headerview.c | 2 ++ - src/setup.c | 8 ++++++++ - src/sslmanager.c | 2 ++ - 4 files changed, 14 insertions(+) - -diff --git a/src/alertpanel.c b/src/alertpanel.c -index 723125e..e23d045 100644 ---- a/src/alertpanel.c -+++ b/src/alertpanel.c -@@ -299,7 +299,9 @@ static void alertpanel_create(const gchar *title, - gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); - gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); - gtk_label_set_selectable(GTK_LABEL(label), TRUE); -+#ifndef __APPLE__ - GTK_WIDGET_UNSET_FLAGS(label, GTK_CAN_FOCUS); -+#endif - #ifdef G_OS_WIN32 - { - GtkStyle *style; -diff --git a/src/headerview.c b/src/headerview.c -index 984e8bc..bc7993c 100644 ---- a/src/headerview.c -+++ b/src/headerview.c -@@ -120,11 +120,13 @@ HeaderView *headerview_create(void) - gtk_label_set_selectable(GTK_LABEL(ng_body_label), TRUE); - gtk_label_set_selectable(GTK_LABEL(subject_body_label), TRUE); - -+#ifndef __APPLE__ - GTK_WIDGET_UNSET_FLAGS(from_body_label, GTK_CAN_FOCUS); - GTK_WIDGET_UNSET_FLAGS(to_body_label, GTK_CAN_FOCUS); - GTK_WIDGET_UNSET_FLAGS(cc_body_label, GTK_CAN_FOCUS); - GTK_WIDGET_UNSET_FLAGS(ng_body_label, GTK_CAN_FOCUS); - GTK_WIDGET_UNSET_FLAGS(subject_body_label, GTK_CAN_FOCUS); -+#endif - - gtk_widget_add_events(from_body_label, GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK); - gtk_widget_add_events(to_body_label, GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK); -diff --git a/src/setup.c b/src/setup.c -index c2f4feb..810e575 100644 ---- a/src/setup.c -+++ b/src/setup.c -@@ -171,7 +171,9 @@ void setup_mailbox(void) - gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); - gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); - gtk_label_set_selectable(GTK_LABEL(label), TRUE); -+#ifndef __APPLE__ - GTK_WIDGET_UNSET_FLAGS(label, GTK_CAN_FOCUS); -+#endif - MODIFY_LABEL_STYLE(); - - vbox = gtk_vbox_new(FALSE, 8); -@@ -194,7 +196,9 @@ void setup_mailbox(void) - gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_MIDDLE); - #endif - gtk_label_set_selectable(GTK_LABEL(label), TRUE); -+#ifndef __APPLE__ - GTK_WIDGET_UNSET_FLAGS(label, GTK_CAN_FOCUS); -+#endif - MODIFY_LABEL_STYLE(); - - g_free(fullpath); -@@ -223,7 +227,9 @@ void setup_mailbox(void) - gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); - gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); - gtk_label_set_selectable(GTK_LABEL(label), TRUE); -+#ifndef __APPLE__ - GTK_WIDGET_UNSET_FLAGS(label, GTK_CAN_FOCUS); -+#endif - MODIFY_LABEL_STYLE(); - - if (prefs_common.comply_gnome_hig) { -@@ -790,7 +796,9 @@ PrefsAccount *setup_account(void) - gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); - gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); - gtk_label_set_selectable(GTK_LABEL(label), TRUE); -+#ifndef __APPLE__ - GTK_WIDGET_UNSET_FLAGS(label, GTK_CAN_FOCUS); -+#endif - MODIFY_LABEL_STYLE(); - - vbox = gtk_vbox_new(FALSE, 8); -diff --git a/src/sslmanager.c b/src/sslmanager.c -index a633710..b8117e9 100644 ---- a/src/sslmanager.c -+++ b/src/sslmanager.c -@@ -169,7 +169,9 @@ gint ssl_manager_verify_cert(SockInfo *sockinfo, const gchar *hostname, - gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0); - gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); - gtk_label_set_selectable(GTK_LABEL(label), TRUE); -+#ifndef __APPLE__ - GTK_WIDGET_UNSET_FLAGS(label, GTK_CAN_FOCUS); -+#endif - #ifdef G_OS_WIN32 - { - GtkStyle *style; --- -2.39.3 (Apple Git-145) -