From c24b8fcd9670c08b60515ff2697974d07f472054 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sun, 15 Sep 2024 08:10:42 +0900 Subject: [PATCH] gtk4: add support for --show-native-window-id --- lib/rabbit/command/rabbit.rb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/rabbit/command/rabbit.rb b/lib/rabbit/command/rabbit.rb index b2e9f32d..52c7cc19 100644 --- a/lib/rabbit/command/rabbit.rb +++ b/lib/rabbit/command/rabbit.rb @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2019 Sutou Kouhei +# Copyright (C) 2004-2024 Sutou Kouhei # # 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 @@ -853,9 +853,16 @@ def do_display setup_3d_info(canvas) frame.init_gui(@options.width, @options.height, true) frame.fullscreen if @options.full_screen - native_window = frame.window.window - if @options.show_native_window_id and native_window.respond_to?(:xid) - @logger.info(_("Window ID: %d") % native_window.xid) + if @options.show_native_window_id + window = frame.window + if window.respond_to?(:surface) + native_surface = window.surface + else + native_surface = window.window + end + if native_surface.respond_to?(:xid) + @logger.info(_("Window ID: %d") % native_surface.xid) + end end apply_theme_if_need(frame) parse(frame, source, !Utils.windows?)