From: <pa...@us...> - 2024-02-18 09:32:15
|
This is an automated email from the git hooks/post-receive-user script. pak21 pushed a commit to branch patch-440-remove-gdk_keymap_get_default in repository fuse. View the commit online: https://sourceforge.net/p/fuse-emulator/fuse/ci/617a6a7987d3c895e2c8837c8afcb92ceaca909a/ commit 617a6a7987d3c895e2c8837c8afcb92ceaca909a Author: Philip Kendall <phi...@sh...> AuthorDate: Sun Feb 18 09:28:12 2024 +0000 Remove use of deprecated `gdk_keymap_get_default` function. --- ui/gtk/gtkdisplay.c | 6 ++---- ui/gtk/gtkinternals.h | 4 +++- ui/gtk/gtkkeyboard.c | 4 ++-- ui/gtk/gtkmouse.c | 6 ++---- ui/gtk/gtkui.c | 6 +++++- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ui/gtk/gtkdisplay.c b/ui/gtk/gtkdisplay.c index 7dcd7c27..006338c3 100644 --- a/ui/gtk/gtkdisplay.c +++ b/ui/gtk/gtkdisplay.c @@ -1,5 +1,5 @@ /* gtkdisplay.c: GTK routines for dealing with the Speccy screen - Copyright (c) 2000-2005 Philip Kendall + Copyright (c) 2000-2024 Philip Kendall This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -618,9 +618,7 @@ gtkdisplay_update_geometry( void ) #ifdef GDK_WINDOWING_WAYLAND /* We don't calculate the window size enough accurately on wayland backend to force the window geometry (bug #367) */ - GdkDisplay *display = gdk_display_get_default(); - - if( GDK_IS_WAYLAND_DISPLAY( display ) ) { + if( GDK_IS_WAYLAND_DISPLAY( gtkui_default_display ) ) { hints &= ~GDK_HINT_RESIZE_INC; } #endif /* #ifdef GDK_WINDOWING_WAYLAND */ diff --git a/ui/gtk/gtkinternals.h b/ui/gtk/gtkinternals.h index e06307f6..3838b243 100644 --- a/ui/gtk/gtkinternals.h +++ b/ui/gtk/gtkinternals.h @@ -1,5 +1,5 @@ /* gtkinternals.h: stuff internal to the GTK UI - Copyright (c) 2003-2015 Philip Kendall + Copyright (c) 2003-2024 Philip Kendall This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -60,6 +60,8 @@ void gtkmouse_init( void ); extern GtkWidget *gtkui_window; extern GtkWidget *gtkui_drawing_area; +extern GdkDisplay *gtkui_default_display; + void gtkui_destroy_widget_and_quit( GtkWidget *widget, gpointer data ); int gtkui_confirm( const char *string ); diff --git a/ui/gtk/gtkkeyboard.c b/ui/gtk/gtkkeyboard.c index c431ba60..0f9d57ab 100644 --- a/ui/gtk/gtkkeyboard.c +++ b/ui/gtk/gtkkeyboard.c @@ -1,5 +1,5 @@ /* gtkkeyboard.c: GTK routines for dealing with the keyboard - Copyright (c) 2000-2008 Philip Kendall, Russell Marks + Copyright (c) 2000-2024 Philip Kendall, Russell Marks This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -43,7 +43,7 @@ unshift_keysym( guint keycode, gint group ) guint *keyvals, i, r = GDK_KEY_VoidSymbol, r2 = GDK_KEY_VoidSymbol; gint count; - gdk_keymap_get_entries_for_keycode( gdk_keymap_get_default(), keycode, + gdk_keymap_get_entries_for_keycode( gdk_keymap_get_for_display( gtkui_default_display ), keycode, &maps, &keyvals, &count ); for( i = 0; i < count; i++ ) { diff --git a/ui/gtk/gtkmouse.c b/ui/gtk/gtkmouse.c index e7ff0508..c2680c53 100644 --- a/ui/gtk/gtkmouse.c +++ b/ui/gtk/gtkmouse.c @@ -1,6 +1,5 @@ /* gtkmouse.c: GTK routines for emulating Spectrum mice - Copyright (c) 2004 Darren Salt - Copyright (c) 2015 Sergio Baldoví + Copyright (c) 2004-2024 Darren Salt, Sergio Baldoví, Philip Kendall This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -120,8 +119,7 @@ gtkmouse_reset_pointer( void ) #ifdef GDK_WINDOWING_WAYLAND - GdkDisplay *display = gdk_display_get_default(); - if( GDK_IS_WAYLAND_DISPLAY( display ) ) { + if( GDK_IS_WAYLAND_DISPLAY( gtkui_default_display ) ) { mouse_motion_fn = mouse_motion_relative; have_last_position = 0; return; diff --git a/ui/gtk/gtkui.c b/ui/gtk/gtkui.c index 835b74e5..bb06fd0e 100644 --- a/ui/gtk/gtkui.c +++ b/ui/gtk/gtkui.c @@ -1,5 +1,5 @@ /* gtkui.c: GTK routines for dealing with the user interface - Copyright (c) 2000-2015 Philip Kendall, Russell Marks, Sergio Baldoví + Copyright (c) 2000-2024 Philip Kendall, Russell Marks, Sergio Baldoví This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -60,6 +60,8 @@ GtkWidget *gtkui_window; /* The area into which the screen will be drawn */ GtkWidget *gtkui_drawing_area; +GdkDisplay *gtkui_default_display; + static GtkWidget *menu_bar; /* The UIManager used to create the menu bar */ @@ -235,6 +237,8 @@ ui_init( int *argc, char ***argv ) gtk_widget_show_all( gtkui_window ); gtkstatusbar_set_visibility( settings_current.statusbar ); + gtkui_default_display = gdk_display_get_default(); + ui_mouse_present = 1; return 0; |