How to update the code below from GTK 3.x to GTK 4.x

How to update the code below from GTK 3.x to GTK 4.x
Tip: m_window_values is a instance of Gtk.Window

int x = 0, y = 0, origin_x = 0, origin_y = 0;
this.get_window().get_origin(out origin_x, out origin_y);
Gdk.Device? pointer = this.get_display().get_default_seat().get_pointer();
this.get_window().get_device_position(pointer, out x, out y, null);
m_window_values.move(origin_x + x, origin_y + y + 20);
m_window_values.resize(400, 450);

There is no way to do this using only GTK4, please read this thread for a further discussion: Gtk4 migration - window management functions gone

You will have to use your backend’s API (Xlib, Win32, etc) if you want to continue using this functionality.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.