Skip to content
  • Kristian Rietveld's avatar
    Rework coordinate transformation to be based on root window · 8846012c
    Kristian Rietveld authored
    The root window contains all the monitors attached to a Mac.  The
    coordinate transformation now both translates the x and y coordinate,
    translating it from the Cocoa monitor coordinate space to the GDK
    coordinate space.  How monitors are laid out in the root window differs
    between Cocoa and GDK, which is why it is important to translate based
    on the root window to get multi monitor setups to work properly.
    
    We have replaced the old y coordinate transformation function with
    new functions that translate both the x and y coordinate.
    
    When creating new toplevels, we have to determine the Cocoa screen on
    which the toplevel should appear and translate the coordinates according
    to that screen.
    
    This change also fixes event handling in case there is a monitor left
    of the screen containing the menu bar.  In such a case all coordinates
    on the left monitor are negative.  Event handling broke, because of
    _gdk_quartz_window_find_child() checking bounds.  Now that coordinates
    are always properly translated to GDK coordinate space, in which negative
    coordinates do never occur, the checks here will work properly.
    8846012c