Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Files
Files
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 444
    • Issues 444
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 30
    • Merge Requests 30
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • FilesFiles
  • Issues
  • #197

Closed
Open
Opened Jan 10, 2018 by Frank Z@Ch3ck3r

Nautilus window opens in wrong location on dual monitor setup

I use a dual monitor setup where the two monitors are above each other (both monitors 1920x1080px). The bottom monitor is set as the primary monitor.

Upon opening a new nautilus window the window geometry and position is read from gsettings. gsettings contains the correct coordinates for the window to open on the primary monitor (the bottom one) (e.g. top : 1300px, left : 300px, width : 600px, height : 500px). Though nautilus will always open its window in such a way, that approximately 100 pixels are visible on the top (secondary) monitor.

This is very disturbing as it prevents me from using nautilus efficiently. I always have to move the nautilus window after i have opened it.

I have had a quick look into the source code of nautilus on github. The problems seems to be in the method sanity_check_window_position (int *left, int *top) in eel-gtk-extensions.c. The following "sanity" check is performed:

    gdk_monitor_get_geometry (gdk_display_get_monitor (gdk_display_get_default (), 0), &geometry); 

    /* Make sure the top of the window is on screen, for
     * draggability (might not be necessary with all window managers,
     * but seems reasonable anyway). Make sure the top of the window
     * isn't off the bottom of the screen, or so close to the bottom
     * that it might be obscured by the panel.
     */
    *top = CLAMP (*top, 0, geometry.height - MINIMUM_ON_SCREEN_HEIGHT);

Obviously gemotry.height is set to 1080px on my setup (because it is the height of one monitor). The window should open on the bottom monitor, so the *top is currently set to 1300px from the gsettings. The "sanity" check will change top to 1080 - MINIMUM_ON_SCREEN_HEIGHT. This moves the window up to the secondary top monitor and opens the window on the wrong screen!

Instead of relying only on geometry.height this sanity check should rely on the actual coordinates of the monitor.

Same problem may exists for the clamping of *left, though i have not tested / noticed a problem with left coordinate yet.

Edited Jan 10, 2018 by Frank Z
To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/nautilus#197