Program border flickering with handbrake-gtk 4394svnppa1

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

Program border flickering with handbrake-gtk 4394svnppa1

Post by linuxuser »

I use handbrake-gtk 4394svnppa1~oneiric1 with Ubuntu 11.10 from "deb http://ppa.launchpad.net/stebbins/handb ... ots/ubuntu oneiric main" and sometimes the "border of the program" starts flickering, which is ended immediately when the mouse is moved. Is this a known bug?
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Program border flickering with handbrake-gtk 4394svnppa1

Post by JohnAStebbins »

Sounds like a problem with your gfx driver or some odd window manager issue. Never heard of it before. Can you describe it in greater detail. Not really picturing it yet. Or maybe you can capture an screenshot?
linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

Re: Program border flickering with handbrake-gtk 4394svnppa1

Post by linuxuser »

I will do my best ASAP. It happens since I changed from Natty stable to Oneiric unstable.
linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

Re: Program border flickering with handbrake-gtk 4394svnppa1

Post by linuxuser »

I made some screenshots, how can I upload them?

The flickering is on the right sight only and I never noticed such a behavior with any other application. I never saw it in full screen mode.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Program border flickering with handbrake-gtk 4394svnppa1

Post by JohnAStebbins »

You'll have to find an image hosting service and post a link. Google finds these. I can't vouch for any.
http://photobucket.com/
http://imageshack.us/
Deleted User 11865

Re: Program border flickering with handbrake-gtk 4394svnppa1

Post by Deleted User 11865 »

Dropbox also has photo sharing functionality.
linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

Re: Program border flickering with handbrake-gtk 4394svnppa1

Post by linuxuser »

http://www.picvalley.net/v.php?p=u/1958 ... 8OtJws.JPG

http://www.picvalley.net/v.php?p=u/1565 ... NtZUTF.JPG

http://www.picvalley.net/v.php?p=u/1628 ... xJnZws.JPG

http://www.picvalley.net/v.php?p=u/2664 ... bow3CQ.JPG

Please watch the right border of the Handbrake-windows. These are random scrennshots, when it flickers on the right side. The name of the window "Handbrake" flickers too. It looks for me, that the size of the window is changing very fast.

I didn't notice this behavior with opensuse 12.1 till now, so I think it is a Ubuntu Oneiric related problem.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Program border flickering with handbrake-gtk 4394svnppa1

Post by JohnAStebbins »

Thanks. That's helpful in explaining what you are seeing. It does indeed look like the window is changing size. It looks like some strange interaction between your window manager and the application. Probably has something to do with the window being slightly larger than your screen. Any chance you can run your monitor at a higher resolution? I'm curious if it fixes itself if the window isn't larger than the screen.

I certainly don't programtically change the window size on purpose. But I do set a window manager hints that tells the window manager what minimum, maximum, and default window geometry I want. I'm thinking this is a WM bug that is somehow triggered by those hints.
linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

Re: Program border flickering with handbrake-gtk 4394svnppa1

Post by linuxuser »

I use XFCE 4.8 with Xubuntu Oneiric, all packages are uptodate. The resolution is 1280x1024 and the handbrake-window is somewhere in the _middle_, and _not_ at the edge of the screen. I cut the screenshot manually to the handbrake window. Sorry, now idea, how to increade the resolution, it is a viewsonic VP930. I can try it on a 24" widescreen from HP. Flickering stops immediately, when I move the handbrake-window with the mouse.

There is a good chance, that it happens after starting handbrake or after a file is fully encoded. As mentioned, I have never seen it with Ubuntu Natty with an earlier handbrake version and with Opensuse with the same hardware. Xubuntu Oneiric and Opensuse 12.1 are on the same machine.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Program border flickering with handbrake-gtk 4394svnppa1

Post by JohnAStebbins »

I should be able to install xfce on my ubuntu vm. So I'll give that a shot and see if it's reproducible. Not sure what I can do about it, but I can fiddle with the WM hints to see if it has any effect.
linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

Re: Program border flickering with handbrake-gtk 4394svnppa1

Post by linuxuser »

Please use Xubuntu Oneiric alternate and not Ubuntu. I use the 64bit version
totaam
Posts: 2
Joined: Sun Mar 16, 2014 7:17 am

handbrake uses invalid window size hints

Post by totaam »

This is definitely a bug in handbrake: there is an obvious bug in the way it calculates window size hints: it comes up with invalid values which the window manager has to sanitize before it can use them.
And even then, handbrake can easily get caught in a loop and continuously try to resize its main window to satisfy those invalid hints.

You can very easily see those invalid size hints using a virtual screen:

Code: Select all

Xvfb -dpi 96 +extension Composite -screen 0 2048x1200x24+32 -nolisten tcp -noreset :20 &
export DISPLAY=:20
metacity &
ghb &
#wait a bit for the main window to show up, then:
WID=`xdotool getactivewindow`
xprop -id $WID | grep "size:"
		program specified minimum size: 1030 by 690
		program specified maximum size: 1024 by 768
		program specified base size: -1 by -1
xdotool getwindowgeometry $WID | grep Geometry
  Geometry: 1030x768
The minimum width is greater than the maximum width.
This is what causes the loop.

It should be possible to reproduce these invalid values using a real Xorg server and tweaking the DPI and/or font size.
And in fact, that may well be the reason why the OP was seeing this problem. Odd settings (ie: high dpi displays) are more likely to trigger this sort of thing.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Program border flickering with handbrake-gtk 4394svnppa1

Post by JohnAStebbins »

Again, this is a bug in your WM. If you look at the code, you will see that ghb *does not* set the minimum size > max size. It sets the minimum size to -1 which tells the WM to choose the minimum size. Your WM chose 1030, not handbrake.

These values are *hints* for the WM. Any WM is free to ignore hints. Yours is making up impossible constraints and attempting to apply them.
linuxuser
Bright Spark User
Posts: 208
Joined: Fri Jan 06, 2012 7:47 pm

Re: Program border flickering with handbrake-gtk 4394svnppa1

Post by linuxuser »

It is a long time ago, that I saw this bug, maybe because I changed the monitor, it is gone.
totaam
Posts: 2
Joined: Sun Mar 16, 2014 7:17 am

Re: Program border flickering with handbrake-gtk 4394svnppa1

Post by totaam »

@JohnAStebbins: The invalid values do come from handbrake, you can try with several window managers or even with none at all. Simply remove metacity from the test case I posted above: no window manager involved, yet the invalid values are still there..

Most window managers will silently drop the invalid hints, others like fvwm will give you this more helpful warning message:

Code: Select all

[fvwm][GetWindowSizeHints]: <<WARNING>> The application window (id 0x600019)
  "HandBrake" has broken size hints (max_width).
    fvwm is ignoring those hints.    hint override = 0, flags = 330
  min_width = 1030, min_height = 667, max_width = 1024, max_height = 768
  width_inc = 0, height_inc = 0
  min_aspect = 0/0, max_aspect = 0/0
  base_width = -1, base_height = -1
  win_gravity = 1

    If you are having a problem with the application, send a bug report
    with this message included to the application owner.
    There is no need to notify fvwm-workers@fvwm.org.
And although you are right that the handbrake code does not explicitly set the min-size hint (it does set the base-size flag without setting valid base size values, but this may not be strictly invalid), GTK will set the min-size for you to ensure that all the widgets added to the window can get their size allocation.
The problem comes from the fact that someone assumed that hardcoding 1024 for max width would be enough for all those widgets when in practise it isn't necessarily so.

I have also found at least one other bug with the XEMBED tray window (which is also caught by the "i3" window manager), which I will report separately in due time.
Post Reply