Gtk: Work around Gtk including frames in window size on Wayland.

This commit is contained in:
BearOso 2025-06-12 15:02:13 -05:00
parent d65a2b31a0
commit c09277bae8
4 changed files with 10 additions and 9 deletions

View File

@ -792,8 +792,9 @@ void Snes9xPreferences::show()
dialog->show();
auto result = dialog->run();
config->preferences_width = get_width();
config->preferences_height = get_height();
auto box = get_object<Gtk::Widget>("preferences_box");
config->preferences_width = box->get_width();
config->preferences_height = box->get_height();
config->current_display_tab = get_object<Gtk::Notebook>("display_notebook")->get_current_page();
switch (result)

View File

@ -491,8 +491,9 @@ bool Snes9xWindow::draw(const Cairo::RefPtr<Cairo::Context> &cr)
if (!(config->fullscreen) && !(maximized_state))
{
config->window_width = get_width();
config->window_height = get_height();
auto vbox = get_object<Gtk::VBox>("main_window_vbox");
config->window_width = vbox->get_width();
config->window_height = vbox->get_height();
}
if (last_width < 0)

View File

@ -28,9 +28,8 @@ static inline double snap_to_interval(double value, double interval)
static void dialog_response(int response_id)
{
gui_config->shader_parameters_width = dialog->get_width();
gui_config->shader_parameters_height = dialog->get_height();
gui_config->shader_parameters_width = dialog->get_vbox()->get_width();
gui_config->shader_parameters_height = dialog->get_vbox()->get_height();
switch (response_id)
{
case Gtk::RESPONSE_OK:

View File

@ -1180,7 +1180,7 @@
<signal name="focus-out-event" handler="focus_out_event" swapped="no"/>
<signal name="focus-in-event" handler="focus_in_event" swapped="no"/>
<child>
<object class="GtkVBox" id="vbox1">
<object class="GtkVBox" id="main_window_vbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
@ -2685,7 +2685,7 @@
<signal name="style-set" handler="style_set" swapped="no"/>
<signal name="key-press-event" handler="on_key_press" swapped="no"/>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox1">
<object class="GtkVBox" id="preferences_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>