Révision | 1b6fa31e29ac664514254bf81c42ebc1b4120407 (tree) |
---|---|
l'heure | 2023-02-07 20:21:35 |
Auteur | phabrics <phabrics@phab...> |
Commiter | phabrics |
Some backport fixes for GTK3.
@@ -32,7 +32,7 @@ dnl ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
32 | 32 | dnl POSSIBILITY OF SUCH DAMAGE. |
33 | 33 | |
34 | 34 | dnl Checks that we are given a good source directory. |
35 | -AC_PREREQ([2.71]) | |
35 | +AC_PREREQ([2.69]) | |
36 | 36 | m4_include(version.m4) |
37 | 37 | AC_INIT([tme],[0.12rc10]) |
38 | 38 | AC_CONFIG_SRCDIR([ic/m68k/m68k-impl.h]) |
@@ -1089,7 +1089,7 @@ LT_CONFIG_LTDL_DIR([libltdl]) | ||
1089 | 1089 | LT_INIT([dlopen,win32-dll]) |
1090 | 1090 | LT_LANG([Windows Resource]) |
1091 | 1091 | LTDL_INIT([recursive installable]) |
1092 | -CPPFLAGS="${CPPFLAGS-} ${LTDLINCL}" | |
1092 | +CPPFLAGS="${CPPFLAGS-} ${LTDLINCL} -DLT_DEBUG_LOADERS" | |
1093 | 1093 | |
1094 | 1094 | AC_ARG_VAR([IFCONFIG], [full path to ipconfig utility]) |
1095 | 1095 | AC_ARG_VAR([ROUTE], [full path to route utility]) |
@@ -40,11 +40,9 @@ _TME_RCSID("$Id: gtk-screen.c,v 1.11 2009/08/30 21:39:03 fredette Exp $"); | ||
40 | 40 | #include "gtk-display.h" |
41 | 41 | #include <stdlib.h> |
42 | 42 | #if GTK_MAJOR_VERSION == 4 |
43 | -#define _tme_gtk_window_toplevels gtk_window_get_toplevels | |
44 | 43 | #define _tme_gtk_init gtk_init_check |
45 | 44 | #else |
46 | -#define _tme_gtk_window_toplevels gtk_window_list_toplevels | |
47 | -static void _tme_gtk_init(void) { | |
45 | +static gboolean _tme_gtk_init(void) { | |
48 | 46 | char **argv; |
49 | 47 | char *argv_buffer[3]; |
50 | 48 | int argc; |
@@ -53,11 +51,11 @@ static void _tme_gtk_init(void) { | ||
53 | 51 | argv = argv_buffer; |
54 | 52 | argc = 0; |
55 | 53 | argv[argc++] = "tmesh"; |
56 | -#if 1 | |
54 | +#if 0 | |
57 | 55 | argv[argc++] = "--gtk-debug=signals"; |
58 | 56 | #endif |
59 | 57 | argv[argc] = NULL; |
60 | - gtk_init_check(&argc, &argv); | |
58 | + return gtk_init_check(&argc, &argv); | |
61 | 59 | } |
62 | 60 | #endif |
63 | 61 |
@@ -73,7 +71,7 @@ _tme_gtk_display_update(struct tme_display *display) { | ||
73 | 71 | for(rc=TRUE;rc && g_main_context_pending(NULL); |
74 | 72 | rc = g_main_context_iteration(NULL, TRUE)); |
75 | 73 | |
76 | - if(rc) rc = g_list_model_get_n_items(_tme_gtk_window_toplevels()); | |
74 | + if(rc) rc = (gtk_window_list_toplevels() != NULL); | |
77 | 75 | return !rc; |
78 | 76 | } |
79 | 77 |
@@ -508,6 +506,21 @@ _tme_display_menu_radio(struct tme_gtk_screen *screen, | ||
508 | 506 | return (menu); |
509 | 507 | } |
510 | 508 | |
509 | +/* this is a GTK callback for an enter notify event, that has the | |
510 | + widget grab focus and then continue normal event processing: */ | |
511 | +gint | |
512 | +_tme_display_enter_focus(GtkWidget *widget, | |
513 | + GdkEvent *gdk_event_raw, | |
514 | + gpointer junk) | |
515 | +{ | |
516 | + | |
517 | + /* grab the focus: */ | |
518 | + gtk_widget_grab_focus(widget); | |
519 | + | |
520 | + /* continue normal event processing: */ | |
521 | + return (FALSE); | |
522 | +} | |
523 | + | |
511 | 524 | /* the new GTK display function: */ |
512 | 525 | TME_ELEMENT_SUB_NEW_DECL(tme_host_gtk,display) { |
513 | 526 | struct tme_gdk_display *display; |
@@ -519,7 +532,7 @@ TME_ELEMENT_SUB_NEW_DECL(tme_host_gtk,display) { | ||
519 | 532 | setuid(getuid()); |
520 | 533 | #endif |
521 | 534 | |
522 | - if(!(rc = _tme_gtk_init())) return rc; | |
535 | + if(rc = !_tme_gtk_init()) return rc; | |
523 | 536 | |
524 | 537 | /* start our data structure: */ |
525 | 538 | display = tme_new0(struct tme_gdk_display, 1); |
@@ -559,5 +572,5 @@ TME_ELEMENT_SUB_NEW_DECL(tme_host_gtk,display) { | ||
559 | 572 | /* unlock mutex once gtk main thread is running: */ |
560 | 573 | // g_idle_add(_tme_gtk_screens_update, display); |
561 | 574 | |
562 | - return (TME_OK); | |
575 | + return rc; | |
563 | 576 | } |