From 87aa5feb8790168eb7b2bc890938353116d26594 Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Sun, 27 Jul 2025 16:07:59 -0400 Subject: Fix GTK deprecations (#798) * menu: replace gtk_menu_popup() with gtk_menu_popup_at_rect() Replace deprecated gtk_menu_popup() with gtk_menu_popup_at_rect(). This provides the same menu positioning calculation while eliminating deprecation warnings. * ui: replace gtk_widget_get_realized() with gtk_widget_get_mapped() Replace deprecated gtk_widget_get_realized() with gtk_widget_get_mapped(). Since mapped widgets are guaranteed to be realized, and we only care about widget visibility, this change eliminates deprecation warnings while maintaining the same functionality. * frames: replace gdk_window_process_all_updates() with gdk_display_flush() Replace deprecated gdk_window_process_all_updates() with gdk_display_flush(). Both functions ensure pending updates are processed, but gdk_display_flush is more general for all display requests. --- src/ui/frames.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/ui/frames.c') diff --git a/src/ui/frames.c b/src/ui/frames.c index ad7e10c8..19c14c56 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -504,7 +504,7 @@ meta_frames_ensure_layout (MetaFrames *frames, MetaFrameType type; MetaFrameStyle *style; - g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (frames))); + g_return_if_fail (gtk_widget_get_mapped (GTK_WIDGET (frames))); widget = GTK_WIDGET (frames); @@ -1310,7 +1310,7 @@ meta_frames_repaint_frame (MetaFrames *frames, /* repaint everything, so the other frame don't * lag behind if they are exposed */ - gdk_window_process_all_updates (); + gdk_display_flush (gdk_display_get_default ()); } static void @@ -2970,8 +2970,7 @@ meta_frames_push_delay_exposes (MetaFrames *frames) if (frames->expose_delay_count == 0) { /* Make sure we've repainted things */ - gdk_window_process_all_updates (); - XFlush (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ())); + gdk_display_flush (gdk_display_get_default ()); } frames->expose_delay_count += 1; -- cgit v1.2.1