baedert / corebird

Native Gtk+ Twitter Client
https://corebird.baedert.org
GNU General Public License v3.0
791 stars 78 forks source link

Non-landscape video can overflow screen #754

Closed IBBoard closed 7 years ago

IBBoard commented 7 years ago

I just recently noticed that clicking videos and clicking pictures results in different behaviour. If you click a picture then it aligns it with the middle of Corebird (vertically) and centre aligns it if that doesn't result in the image leaving the desktop. If it would leave the desktop (e.g. you've got Corebird on the left of your screen) then it moves the picture to the right so that it is all visible.

If you click a landscape-proportioned video then the same thing happens, but for non-landscape (e.g. square or portrait videos from phones) then it only ever centre aligns and so the content can get lost.

Tested with Git Master. Hopefully the pictures explain.

Landscape videos get shifted if they hit the screen edge: corebirdvideoalignmentbug-landscapewithspace corebirdvideoalignmentbug-landscapewithoutspace

Square/portrait videos don't: corebirdvideoalignmentbug-squarewithspace corebirdvideoalignmentbug-squarewithoutspace

baedert commented 7 years ago

Corebird doesn't control the window placement of course. I guess the problem is more that the window gets resized to a size bigger than the monitor in the first place and mutter just bails out of such calculations in that case.

Vistaus commented 7 years ago

It's not only limited to videos. Square photos overflow the screen as well.

IBBoard commented 7 years ago

Really? Any examples? Because I thought I'd only had it happen with square and portrait videos. I'd never noticed it with pictures.

If this is a window manager issue rather than a Corebird issue, is there anything that we can do to debug/prove it so that we can write an upstream bug report that might get fixed?

Vistaus commented 7 years ago

@IBBoard Yes, I have my own pictures as an example 'cause my phone takes square pictures by default.

screenshot from 2017-07-28 14 44 40

screenshot from 2017-07-28 14 44 48

IBBoard commented 7 years ago

Is it losing anything off the left-hand side? If you move Corebird to the middle of your screen, is the overlap on the right spread evenly between the left and right sides?

Top and bottom cropping is expected with Corebird (it does vertical scroll) but the shadow on the left in the clicked version appears to match the shadow on the left in the version in the timeline (which isn't cropped).

baedert commented 7 years ago

We probably just shouldn't use a size for the dialog that doesn't fit in the screen at all, vertically or horizontally. That would also fix/work-around the issue of portrait mode phone videos.

IBBoard commented 7 years ago

I wondered whether anything like that could be done, and I tried to do it over the weekend, but I didn't know enough about Cairo/GStreamer to work out how to scale a video. Also, I wasn't sure what impact it would have (how bad the CPU load would be).