Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Image / video preview extends beyond confines of monitor #59

Closed

Description

@rodneyrod

I have a dual screen setup with a 900x1440 monitor that has Cawbird running normally.

I've noticed that some pictures and videos will open wider than the length of the monitor and spill over onto my other display.

It's not a huge issue, but I was wondering if there was a way to restrict the preview windows to rescale automatically down to the size of the monitor it's being displayed on?

Using Manjaro Gnome 64bit if that helps too.

Activity

  1. IBBoard commented on Nov 18, 2019

    @IBBoard
    Owner

    Odd. I've never seen it as an issue for vertical overflow on a single monitor.

    I'll have to investigate, but in theory we've already got code that limits it to 95% of your screen size. Maybe that sees the dual screen setup as one extra-wide monitor?

    Can you give me an example tweet to test?

  2. added
    bugSomething isn't working
    designUI and design issues
    info requiredThis doesn't seem right or more details are required
    on Nov 18, 2019
  3. rodneyrod commented on Nov 30, 2019

    @rodneyrod
    Author

    The picture in this one extends over the monitor edge on my display.
    https://twitter.com/RussianMemesLtd/status/1200681618933010432

  4. IBBoard commented on Nov 30, 2019

    @IBBoard
    Owner

    Okay, image is 1124×1093.

    When you say 900×1440, do you mean you've got your monitors in portrait?

    I'm also wondering about gdk_screen_get_default and whether that sees multi-desktop as a single screen. I'll have to investigate.

  5. rodneyrod commented on Nov 30, 2019

    @rodneyrod
    Author

    That's right, that monitor is in portrait

  6. removed
    info requiredThis doesn't seem right or more details are required
    on Jan 12, 2020
  7. IBBoard commented on Jan 21, 2020

    @IBBoard
    Owner

    Apparently X merges screens and treats them as one big one. This will need a bit of a work-around, possibly involving swapping to GdkDisplay and GdkMonitor instead of GdkScreen (which seems to be partially deprecated, especially when it comes to monitors)

    This may also fix some build warnings such as: ../src/CbMediaVideoWidget.c:359:3: warning: ‘gdk_screen_get_height’ is deprecated [-Wdeprecated-declarations]

  8. added a commit that references this issue on Jan 25, 2020
  9. IBBoard commented on Jan 25, 2020

    @IBBoard
    Owner

    That change should fix the problem to the greatest extent that Cawbird can manage (AFAIK).

    The image should now be no more than 95% of 900px wide, so as long as Cawbird is in the middle of your monitor or further away from your second monitor then it should now all stay on one screen.

    If Cawbird is closer to the joining edge of the two monitors then your window manager may still decide to just centralise the image over the Cawbird main window, which could still overflow. But I believe that's just the window manager's behaviour and we're stuck with it.

    Can you try the fix out and tell me whether it works?

  10. rodneyrod commented on Jan 27, 2020

    @rodneyrod
    Author

    Tried the latest build, no change when I've dragged on either monitor and on both edges of the 900px screen.
    Tested with this image:
    https://twitter.com/RussianMemesLtd/status/1221451980251353088

    Would have thought this would work on Gnome Shell at least.
    Do you think running it in Wayland might yield different results?

  11. added a commit that references this issue on Jan 28, 2020
  12. IBBoard commented on Jan 28, 2020

    @IBBoard
    Owner

    Okay, if you can build and test b1d3427 then it should have some debugging in that will help me understand what's going on. You might need to run it as G_MESSAGES_DEBUG=cawbird cawbird. The extra debugging will show when you click an image, e.g.:

    (cawbird:9925): cawbird-DEBUG: 19:34:36.018: TweetUtils.vala:341: Num monitors: 1
    (cawbird:9925): cawbird-DEBUG: 19:34:36.019: TweetUtils.vala:344: Monitor 0: BNQ DP-0 - 2560×1440 (work area 2560×1413)
    (cawbird:9925): cawbird-DEBUG: 19:34:36.020: TweetUtils.vala:347: Current monitor: BNQ DP-0 - 2560×1440 (work area 2560×1413)
    (cawbird:9925): cawbird-DEBUG: 19:34:36.020: TweetUtils.vala:350: Max dimensions: 2432×1342
    

    I'm running Gnome Shell on X, so I doubt Wayland will make a difference.

  13. IBBoard commented on Jan 30, 2020

    @IBBoard
    Owner

    I've tested on my dual-monitor setup at work (without a portrait display). It looks like it should be working. Notice how the max dimensions differ vertically because the Gnome main bar is only on one monitor and so it has a smaller "work area".

    (cawbird:5740): cawbird-DEBUG: 09:28:58.552: TweetUtils.vala:341: Num monitors: 2
    (cawbird:5740): cawbird-DEBUG: 09:28:58.553: TweetUtils.vala:344: Monitor 0: DEL DP-2 - 2560×1440 (work area 2560×1413)
    (cawbird:5740): cawbird-DEBUG: 09:28:58.553: TweetUtils.vala:344: Monitor 1: DEL DP-1 - 2560×1440 (work area 2560×1440)
    (cawbird:5740): cawbird-DEBUG: 09:28:58.553: TweetUtils.vala:347: Current monitor: DEL DP-1 - 2560×1440 (work area 2560×1440)
    (cawbird:5740): cawbird-DEBUG: 09:28:58.553: TweetUtils.vala:350: Max dimensions: 2432×1368
    (cawbird:5740): cawbird-DEBUG: 09:29:13.218: TweetUtils.vala:341: Num monitors: 2
    (cawbird:5740): cawbird-DEBUG: 09:29:13.219: TweetUtils.vala:344: Monitor 0: DEL DP-2 - 2560×1440 (work area 2560×1413)
    (cawbird:5740): cawbird-DEBUG: 09:29:13.219: TweetUtils.vala:344: Monitor 1: DEL DP-1 - 2560×1440 (work area 2560×1440)
    (cawbird:5740): cawbird-DEBUG: 09:29:13.220: TweetUtils.vala:347: Current monitor: DEL DP-2 - 2560×1440 (work area 2560×1413)
    (cawbird:5740): cawbird-DEBUG: 09:29:13.220: TweetUtils.vala:350: Max dimensions: 2432×1342 
    

    Can you confirm which version you've tested?

  14. added
    info requiredThis doesn't seem right or more details are required
    on Jan 30, 2020
  15. rodneyrod commented on Feb 2, 2020

    @rodneyrod
    Author

    Tested with the following picture:

    Results from the vertical monitor:

    (cawbird:15297): cawbird-DEBUG: 14:06:53.653: TweetUtils.vala:341: Num monitors: 2
    (cawbird:15297): cawbird-DEBUG: 14:06:53.654: TweetUtils.vala:344: Monitor 0: DEL DisplayPort-1 - 2560×1440 (work area 2560×1402)
    (cawbird:15297): cawbird-DEBUG: 14:06:53.654: TweetUtils.vala:344: Monitor 1: SAM DVI-D-0 - 900×1440 (work area 900×1440)
    (cawbird:15297): cawbird-DEBUG: 14:06:53.654: TweetUtils.vala:347: Current monitor: SAM DVI-D-0 - 900×1440 (work area 900×1440)
    (cawbird:15297): cawbird-DEBUG: 14:06:53.654: TweetUtils.vala:350: Max dimensions: 855×1368
    

    Results from the 1440p monitor:

    (cawbird:28463): cawbird-DEBUG: 14:23:15.199: TweetUtils.vala:341: Num monitors: 2
    (cawbird:28463): cawbird-DEBUG: 14:23:15.199: TweetUtils.vala:344: Monitor 0: DEL DisplayPort-1 - 2560×1440 (work area 2560×1402)
    (cawbird:28463): cawbird-DEBUG: 14:23:15.199: TweetUtils.vala:344: Monitor 1: SAM DVI-D-0 - 900×1440 (work area 900×1440)
    (cawbird:28463): cawbird-DEBUG: 14:23:15.199: TweetUtils.vala:347: Current monitor: DEL DisplayPort-1 - 2560×1440 (work area 2560×1402)
    (cawbird:28463): cawbird-DEBUG: 14:23:15.199: TweetUtils.vala:350: Max dimensions: 2432×1332
    

    Now this is odd because the program is reporting the max dimensions as 855×1368, but the width is definitely longer than the edge of my monitor.
    Here's a screenshot of the render extending between my monitors, the white background on the right half showing the monitor border, and the image preview extending past that:

    https://imgur.com/a/3RVaSbN

    And here's a link to the tweet tested:
    https://twitter.com/RussianMemesLtd/status/1222903042057461760

    EDIT: I'm also using these UI extensions if they might affect rendering:
    Arc Menu
    Dash to Panel
    Topicons Redux
    Gtile

  16. IBBoard commented on Feb 2, 2020

    @IBBoard
    Owner

    So that screenshot is the width of your monitor plus the overlap? There's nothing more to the left? (I've just measured in Gimp and it appears to be 900px wide).

    That… doesn't make much sense. I'll have to double-check what is happening, because if it's showing that logging then it's doing the cropping! Unless there's some behaviour in the widget that I'm not accounting for.

  17. rodneyrod commented on Feb 2, 2020

    @rodneyrod
    Author

    Think I found the problem, I disabled the 1440p monitor so it was just the vertical one, and the widget didn't crop or resize the image at all.
    Code from the debug log:

    (cawbird:10537): cawbird-DEBUG: 22:11:49.619: TweetUtils.vala:341: Num monitors: 1
    (cawbird:10537): cawbird-DEBUG: 22:11:49.620: TweetUtils.vala:344: Monitor 0: SAM DVI-D-0 - 900×1440 (work area 900×1402)
    (cawbird:10537): cawbird-DEBUG: 22:11:49.620: TweetUtils.vala:347: Current monitor: SAM DVI-D-0 - 900×1440 (work area 900×1402)
    (cawbird:10537): cawbird-DEBUG: 22:11:49.620: TweetUtils.vala:350: Max dimensions: 855×1332
    
  18. IBBoard commented on Feb 2, 2020

    @IBBoard
    Owner

    Okay, so seemingly something isn't honouring the size and I just don't see it because my monitor is big enough and the logging looks okay.

    Do you have the same problem with videos? Because I tested those with an arbitrary max size (since they have slightly different logic and scale to keep the proportions, rather than cropping) and they seemed okay.

  19. rodneyrod commented on Feb 2, 2020

    @rodneyrod
    Author

    Just had a quick test with some of the videos in my feed, none of them overflowed, but I might need to find a video that's a little wider to test with properly.

  20. IBBoard commented on Feb 2, 2020

    @IBBoard
    Owner

    Turns out it was my fault it wasn't doing the right thing. An "if image size is less than max size then use the image size" statement became an "if image size is greater than max size then constrain it" statement and I didn't move the "don't scroll" call out of the block, so GTK was being helpful and saying "if you want it X by Y but you also don't want scrolling then I'll ignore the X by Y".

  21. removed
    info requiredThis doesn't seem right or more details are required
    on Feb 2, 2020
  22. rodneyrod commented on Feb 4, 2020

    @rodneyrod
    Author

    Thanks so much, works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdesignUI and design issues

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions