Skip to content

adjust minimum height/width constraints for smaller screen sizes #65

Closed

Description

@ipkpjersi

Description

I believe the minimum height is too large for my setup and causes the GitHub Desktop to open up with maximum height on the wrong monitor.

Version

  • GitHub Desktop: 1.4.0-linux2 (also happened on 1.3.x and earlier) snap
  • Operating system: Ubuntu 16.04 with Xfce 4.12

Steps to Reproduce

  1. Open GitHub desktop on Ubuntu 16.04 Xfce 4.12 with a 768p screen with a 48 pixel tall bottom panel/bar/dock and a 30 pixel tall top panel/bar/dock (whatever you want to call it)
  2. It now opens on my second monitor (a 1080p screen)

Expected Behavior

I expect it to open minimum size for height and width as it does on two 1080p monitors.

Actual Behavior

The minimum height of GitHub desktop is too large. Is there any way to decrease the minimum height - even if just for the Linux port, or maybe upstream? Or, perhaps fixing it so that it opens with the correct minimum height on my second monitor? I am not sure if this issue belongs upstream or in the Linux port.

Keep in mind, when I launch GitHub desktop with my mouse on my second (1080p) screen, the minimum height and width are what they should be - it is only when I keep my mouse on my primary (768p) screen that the height becomes maximum.

Sorry for my very strange use-case, but, these things happen in life.

Here are some (horizontally cropped to redact info) pictures that show what I am talking about.

Here is an example of the issue I am talking about:
screenshot

Here is what it should look like:
screenshot2

Notice the 713px height instead of the 1080px height.

Activity

  1. asianjakepaul commented on Sep 22, 2018

    @asianjakepaul

    Have you tried to reproduce this issue with different electron based applications like atom?

  2. ipkpjersi commented on Sep 22, 2018

    @ipkpjersi
    Author

    I have not. However, this is only really particularly an issue for me on GitHub Desktop as I start Atom maximized - I understand that may be useful troubleshooting information.

  3. asianjakepaul commented on Sep 22, 2018

    @asianjakepaul

    Can you test this with atom, I doubt this is an issue in github desktop but more like an electron issue or even your desktop environment / window manager.

  4. ipkpjersi commented on Sep 22, 2018

    @ipkpjersi
    Author

    I am not sure if I will be able to effectively test this with Atom - Atom doesn't have a minimum size like GitHub Desktop does - if GitHub Desktop reduced the minimum size (or removed it altogether) - it would likely solve this issue for me entirely, since it would fit on my second monitor and I believe this would not be an issue anymore since it would save the dimensions. I cannot resize GitHub Desktop smaller than 714 pixels tall which I believe is what causes this issue.

  5. asianjakepaul commented on Sep 22, 2018

    @asianjakepaul

    I didn't notice github desktop always starts with a height of 960px, It looks like there is an API for getting primary screen size, not sure if this should only be in the linux fork.

    https://github.com/electron/electron/blob/master/docs/api/screen.md

    My personal preference for a fix would be to launch the app using the last window state, for example if you close the window with height: 600, width: 1000 it would use those values the next time it launches.

    Best would be to fix this upstream, I guess there are windows and osx user's that could benefit from this feature.

  6. shiftkey commented on Sep 23, 2018

    @shiftkey
    Owner

    The relevant parts to this issue...

    • We set an absolute minimum height and width for Desktop here:

    private minWidth = 960
    private minHeight = 660

    • We combine this with the remembered values from electron-window-state:

    const savedWindowState = windowStateKeeper({
    defaultWidth: this.minWidth,
    defaultHeight: this.minHeight,
    })

    • These are then provided to the Electron BrowserWindow constructor:

    const windowOptions: Electron.BrowserWindowConstructorOptions = {
    x: savedWindowState.x,
    y: savedWindowState.y,
    width: savedWindowState.width,
    height: savedWindowState.height,
    minWidth: this.minWidth,
    minHeight: this.minHeight,
    show: false,
    // This fixes subpixel aliasing on Windows
    // See https://github.com/atom/atom/commit/683bef5b9d133cb194b476938c77cc07fd05b972
    backgroundColor: '#fff',
    webPreferences: {
    // Disable auxclick event
    // See https://developers.google.com/web/updates/2016/10/auxclick
    disableBlinkFeatures: 'Auxclick',
    // Enable, among other things, the ResizeObserver
    experimentalFeatures: true,
    },
    acceptFirstMouse: true,
    }

    The last time I looked at these values it was related to desktop#4320 (comment) which was in reference to Aero Snap on Windows (which lets you easily move a window to a quarter of the screen) and we talked about the downsides of just relaxing this constraint here: desktop#1702 (comment)

  7. ipkpjersi commented on Sep 23, 2018

    @ipkpjersi
    Author

    @asianjakepaul The app does launch with the last window state - the problem is, with the minimum height being set to what it is, I can't set it to small enough that it doesn't cause this issue.

    @shiftkey Is this something you might be willing to fix? Perhaps you could leave the default size (on very first launch before it is resized) the same but decrease the minimum height? This might be more common than you think, since it does happen on 768p monitors - and there's a surprising number of laptops with 1366x768.

  8. MPLew-is commented on Sep 24, 2018

    @MPLew-is

    As another use case that is currently being prevented by the sizing being what it is, it's difficult to use the app on a MacBook Pro 13" with effective resolution of 1680x1050; I would prefer to have my screen split to left and right halves, meaning I would want GitHub Desktop to be 840 pixels wide, which is prevented by the current configuration.

  9. ipkpjersi commented on Sep 24, 2018

    @ipkpjersi
    Author

    I am glad to see it's not just me having issues with this, hopefully that means it will be more likely for this to get fixed. 😃

  10. shiftkey commented on Sep 24, 2018

    @shiftkey
    Owner

    @shiftkey Is this something you might be willing to fix?

    @ipkpjersi changing numbers around isn't hard, but I don't really have the bandwidth or right setup to dig into this currently. I'd love for someone who is actually feeling this pain to dig into it and suggest a way forward.

    I'll also call out this comment from desktop#1702

    While I could see us perhaps allowing a slightly lower minimum height (say ~600) the current values were definitely chosen deliberately to work on the absolute majority of our users screens while guaranteeing us the screen real-estate we need and are going to need for the features we're planning.

    So what I'd love to see from someone affected by this issue:

    • propose a new minimum height/width default for the app, and how you came to that conclusion
    • build the app from source with these new values. The setup instructions will help with this.
    • testing out locally what the app looks like at this new minimum size in the changes tab (so you see the list of files and the diff). Does that feel like enough space for the app? Can you share a screenshot or two of things so others can follow along?
    • test out the app in the history view when comparing a feature branch to your default branch. Again, does it feel like there's enough space? Can you share some screenshots too?

    Rather than just changing values and having to go through lots of testing to uncover the impact, having someone do this now will give us an idea of the overall impact to reducing the minimum dimensions of the app. And if we feel like shipping some Linux-specific builds to test this we can do this out of band and get even more insight before we take this upstream.

  11. bb441db commented on Sep 24, 2018

    @bb441db

    I think we should just omit this line

    minHeight: this.minHeight,
    it will still launch with a height of 660, but users are at least able to resize the window to something that fits their screen (right now its 660 and not resizable).

  12. ipkpjersi commented on Sep 25, 2018

    @ipkpjersi
    Author

    That seems like a great idea, making it resizeable below that minimum height would fix this issue because then I could resize it to below the minimum height after launching it and then it would save that height for any launches after that - which would fix the problem.

  13. changed the title [-]Opening GitHub Desktop on 768p monitor forces it to open maximum height on 1080p monitor[/-] [+]adjust minimum height/width constraints for smaller screen sizes[/+] on Nov 2, 2018
  14. self-assigned this
    on May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions