What is the proper replacement of GdkScreen in Gtk4


I’m trying to port some gtk3 projects to gtk4. And I found that a lot of projects use gdk_app_launch_context_set_screen to open windows in certain GdkScreen. What is the proper replacement of gdk_app_launch_context_set_screen in Gtk4?


GdkScreen was a remnant of the days when GTK only worked on X11, and mapped Xlib data structures into GDK; it was removed in GTK4 because even in GTK3 there has always been a single GdkScreen object: Gtk – 4.0: Migrating from GTK 3.x to GTK 4

You don’t really need to replace with something else; at most you can set a different GdkDisplay connection, but it’s not really necessary: Gdk.AppLaunchContext

Most functionality you could want has been moved to GdkDisplay. But there wasn’t much functionality you would want in the first place…

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