mono / xwt

A cross-platform UI toolkit for creating desktop applications with .NET and Mono
MIT License
1.37k stars 241 forks source link

[Gtk] Window starts on wrong display #598

Open harry-cpp opened 8 years ago

harry-cpp commented 8 years ago

Window always starts on primary display instead of the display it's run from.

sevoku commented 8 years ago

This is normal behavior, cause the engines do not keep track of that information. You can query the screens and save/restore the position of the window.

harry-cpp commented 8 years ago

This is normal behavior, cause the engines do not keep track of that information. You can query the screens and save/restore the position of the window.

It's not normal for Linux, on Linux when you start the application for the first time it starts on a display where the mouse is. For the most part this can be fixed by moving the start position code from Xwt to Xwt.Platform, and letting the system decide where to put window by calling (in case of Gtk) .SetPosition(Gtk.WindowPosition.Center);, which will give correct display.

sevoku commented 8 years ago

Oh, I see, you're talking about https://developer.gnome.org/gtk2/stable/GtkWindow.html#gtk-window-set-position. Yes, we should set a default value for this, and consider adding it to the Xwt API. Thanks!