Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gtk gtk
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,603
    • Issues 1,603
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 220
    • Merge requests 220
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • gtkgtk
  • Merge requests
  • !3894

x11: Fix handling of `RRScreenChangeNotify`/`RRNotify` events

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Ian Douglas Scott requested to merge ids1024/gtk:randr into master Aug 28, 2021
  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 1

It seems these are sent with xwindow set to the root window, so this was failing to find a surface and get the screen from that.

I'm not sure if there's a reason not to get the screen this way elsewhere in the function, but it seems this should be correct.

This fixes the behavior of gdk_x11_display_get_monitors(), which wasn't correctly changing when monitors were added or removed. For instance, this python code was always showing the same number of monitors when one was turned off and on, but updates correctly with this change applied:

import gi
gi.require_version("GLib", "2.0")
gi.require_version("Gdk", "4.0")
gi.require_version("Gtk", "4.0")
from gi.repository import GLib, Gdk, Gtk

def f():
    print(len(Gdk.Display.get_default().get_monitors()))
    return True
GLib.timeout_add_seconds(1, f)

GLib.MainLoop().run()
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: randr