Gtk2::Gdk::Screen(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

πŸ’– Gtk2::Gdk::Screen πŸ’–

okay so bestie, welcome to Gtk2::Gdk::Screen β€” it's the Perl wrapper for GdkScreen, which is basically the vibe of an entire physical screen (or a screen-like thing) that your GTK+ app is living on. it's from the gtk2-perl docs, the user-contributed Perl kind, and it's giving "I know exactly how many monitors you have and I'm not afraid to tell you" πŸ’…


🌸 HIERARCHY 🌸

this is the family tree, and it's a short one:

Glib::Object
+----Gtk2::Gdk::Screen

so like. it's a Glib::Object girlie, and that's the whole lineage. iconic minimalism, honestly. πŸ‘‘


✨ METHODS ✨

here's the whole roster, no skips, no cuts, fr fr:

  • window = $screen->get_active_window β€” grabs you the currently active window on the screen.
    • Since: gtk+ 2.10
  • $screen->broadcast_client_message ($event) β€” shouts a client message out to everyone listening.
    • $event (Gtk2::Gdk::Event)
  • colormap = $screen->get_default_colormap β€” the default colormap for this screen.
  • $screen->set_default_colormap ($colormap) β€” sets that default colormap.
    • $colormap (Gtk2::Gdk::Colormap)
  • screen or undef = Gtk2::Gdk::Screen->get_default β€” a class method! hands you the default screen, or undef if there just isn't one. it's giving "maybe, maybe not" πŸ™ˆ
  • display = $screen->get_display β€” the display this screen belongs to.
  • fontoptions or undef = $screen->get_font_options β€” the font options, possibly undef.
    • Since: gtk+ 2.10
  • $screen->set_font_options ($options) β€” set the font options.
    • $options (Cairo::FontOptions or undef)
    • Since: gtk+ 2.10
  • integer = $screen->get_height β€” the height, in pixels, as an integer.
  • integer = $screen->get_height_mm β€” the height, but in millimeters. yes, real-world units. she contains multitudes. πŸ“
  • boolean = $screen->is_composited β€” true/false: is this screen composited?
    • Since: gtk+ 2.10
  • list = $screen->list_visuals β€” Returns a list of Gtk2::Gdk::Visual's.
  • string = $screen->make_display_name β€” builds a display name string for you.
  • integer = $screen->get_monitor_at_point ($x, $y) β€” which monitor is at this point?
    • $x (integer)
    • $y (integer)
  • integer = $screen->get_monitor_at_window ($window) β€” which monitor is this window chillin' on?
    • $window (Gtk2::Gdk::Window)
  • rectangle = $screen->get_monitor_geometry ($monitor_num) β€” the geometry (a rectangle) of the given monitor.
    • $monitor_num (integer)
  • integer = $screen->get_monitor_height_mm ($monitor_num) β€” that monitor's height in millimeters.
    • $monitor_num (integer)
    • Since: gtk+ 2.14
  • unsigned = $screen->get_monitor_output ($monitor_num) β€” the monitor's output, as an unsigned value.
    • $monitor_num (integer)
    • Since: gtk+ 2.14
  • string or undef = $screen->get_monitor_plug_name ($monitor_num) β€” the plug name of the monitor, or undef.
    • $monitor_num (integer)
    • Since: gtk+ 2.14
  • integer = $screen->get_monitor_width_mm ($monitor_num) β€” that monitor's width in millimeters.
    • $monitor_num (integer)
    • Since: gtk+ 2.14
  • integer = $screen->get_n_monitors β€” how many monitors, bestie. the count. the number. πŸ‘€
  • integer = $screen->get_number β€” the screen's number.
  • integer = $screen->get_primary_monitor β€” which one is the main character monitor.
    • Since: gtk+ 2.20
  • double = $screen->get_resolution β€” the resolution, as a double.
    • Since: gtk+ 2.10
  • $screen->set_resolution ($dpi) β€” set the resolution.
    • $dpi (double)
    • Since: gtk+ 2.10
  • colormap = $screen->get_rgb_colormap β€” the RGB colormap.
  • visual = $screen->get_rgb_visual β€” the RGB visual.
  • colormap or undef = $screen->get_rgba_colormap β€” the RGBA colormap, or undef.
    • Since: gtk+ 2.8
  • visual or undef = $screen->get_rgba_visual β€” the RGBA visual, or undef.
    • Since: gtk+ 2.8
  • window = $screen->get_root_window β€” the root window of the screen. the origin story. 🌱
  • integer = $screen->get_screen_number β€” the screen number, as an integer.
    • Since: gtk+ 2.2
  • scalar = $screen->get_setting ($name) β€” pull a setting by name.
    • $name (string)
  • boolean = $screen->supports_net_wm_hint ($property) β€” does this screen support the given _NET_WM hint property? true/false.
    • $property (Gtk2::Gdk::Atom)
    • Since: gtk+ 2.2
  • colormap = $screen->get_system_colormap β€” the system colormap.
  • visual = $screen->get_system_visual β€” the system visual.
  • list = $screen->get_toplevel_windows β€” Returns a list of Gtk2::Gdk::Window's.
  • integer = $screen->get_width β€” the width, in pixels.
  • integer = $screen->get_width_mm β€” the width, in millimeters. metric girlie representation 🫢
  • string = $screen->get_window_manager_name β€” the name of the window manager, as a string.
    • Since: gtk+ 2.2
  • list = $screen->get_window_stack β€” the window stack, as a list. stacking order matters, bestie, it's a whole hierarchy of who's on top πŸ’…
    • Since: gtk+ 2.10

πŸŽ€ PROPERTIES πŸŽ€

two properties, both absolute divas:

  • 'font-options' (gpointer : default 0 : readable / writable / private / static-nick / static-blurb) β€” The default font options for the screen
  • 'resolution' (double : default -1 : readable / writable / private / static-nick / static-blurb) β€” The resolution for fonts on the screen

πŸ”” SIGNALS πŸ””

these are the moments she yells at you, and honestly? valid:

  • composited-changed (Gtk2::Gdk::Screen)
  • monitors-changed (Gtk2::Gdk::Screen)
  • size-changed (Gtk2::Gdk::Screen)

πŸ‘€ SEE ALSO πŸ‘€

go read these too, iykyk:

  • Gtk2
  • Glib::Object

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL. See Gtk2 for a full notice.


no cap, that's the whole page. go forth and interrogate your monitors. πŸ¦‹

okay and the official receipts, bestie: this was perl v5.42.0, dated 2025-07-25, filed under Gtk2::Gdk::Screen(3). mwah, periodt πŸ’…βœ¨

πŸ“¦ where this page comes from