Re: Pixel size of primary monitor?




On Wed, 13 Feb 2019 at 14:55, Peter Weber via gtkmm-list <gtkmm-list gnome org> wrote:
Glib::RefPtr<Gdk::Monitor> primary_monitor = window->get_screen()->get_display()->get_primary_monitor();
if (primary_monitor) {
    Gdk::Rectangle monitor_size;
    primary_monitor->get_geometry(monitor_size);
    // adapt size
    width = monitor_size.get_width() / 1.8;
    height = monitor_size.get_height() / 2;
}

This works on X11 and Windows, but not on Wayland! I've get a nullptr and the defaults for width/height are used instead.


See https://gitlab.gnome.org/GNOME/gtk/issues/1028 "No monitor reported as primary by GDK under Wayland"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]