2lss
Full Member
Posts: 140
|
Post by 2lss on Dec 29, 2010 10:28:07 GMT 1
I noticed this when working with "gtk_widget_show_all" and "gtk_widget_hide" but thought it was a typographical error.
I then tried it with HUG and noticed the same behavior. Here is an example:
INCLUDE "hug.bac"
SUB start_test PRINT "HIDE/SHOW" HIDE(win) SHOW(win)
END SUB
win = WINDOW("Test 3", 150, 200) button = BUTTON("Start Test", 100, 50) ATTACH(win, button, 25, 75) CALLBACK(button, start_test)
DISPLAY
The issue is (at least for me) that every time the window is hidden then shown, its position on the screen moves down a little bit. It will continue to do this every time you hide/show the window until it reaches the bottom of the screen. If you move the window to a new position then hide/show, it will start moving down from the new position.
I do not see this behavior with programs written in C.
Any ideas?
|
|
|
Post by Pjot on Dec 29, 2010 11:06:13 GMT 1
Hi 2lss,
Strange! On my Ubu64/32, Redhat 5.4 AS and Slack your program works, without the window changing position at all.
Probably this is an issue with the Window Manager - on my platforms it is all Gnome, and no problems there.
So what Linux version are you using? What GTK version? Which Window Manager?
Thanks, Peter
|
|
2lss
Full Member
Posts: 140
|
Post by 2lss on Dec 29, 2010 11:53:06 GMT 1
I never thought about the window manager, but it turns out thats the problem. System is Ubuntu 10.04, gtk version is 2.20, wm is compiz. I switched to metacity, and the problem went away. I don't understand why it would only affect bacon compiled programs though.
|
|
|
Post by Pjot on Dec 29, 2010 12:00:35 GMT 1
Me neither, as BaCon in reality is a C program also... Can you show a small C program which is not bothered by this issue? Thanks, Peter
|
|
2lss
Full Member
Posts: 140
|
Post by 2lss on Dec 29, 2010 12:13:53 GMT 1
I attached the program that I used to test. After looking around a bit, I found this bug report: bugs.launchpad.net/ubuntu/+source/compiz/+bug/155101Comment #11 mentions that the "Place Windows" feature is the culprit. I will try the fix mentioned tomorrow. I need some sleep.
|
|
|
Post by Pjot on Dec 29, 2010 12:27:56 GMT 1
Thanks 2lss,
According to the bug report it also happens with other programs like Pidgin, GIMP, Nautilus etc.
So it seems this issue is not specific for the HUG programs or any other BaCon GUI program.
The main difference with your small C program and HUG is the way the 'gtk_widget_set_size_request' call is used. In HUG, both dimensions are specified explicitly, while in your demo program only the 'width' parameter has a value and the 'height' parameter is put to -1 (meaning the natural height).
That could explain the reason why the window moves down (vertically). But then this is not a bug I can fix myself...
Regards Peter
|
|
2lss
Full Member
Posts: 140
|
Post by 2lss on Dec 30, 2010 9:11:51 GMT 1
I played around with this today, just to see if there was a workaround. The only other program I notice this issue with is GIMP. Pidgin and Nautilus are not affected. I tried changing some compiz settings as well but none made a difference.
I also tried changing the y size argument in "gtk_widget_set_size_request" to -1 (in the gmail program), but that did not make a difference.
I then converted the small C program from my last post to bacon (to the best of my ability) and to my surprise, it moves down!
Not that I am trying to beat a dead horse, I'm just baffled as to why the compiz bug affects the bacon program and not the C program.
But anyways, thanks for the help.
|
|
|
Post by Pjot on Dec 30, 2010 9:19:23 GMT 1
Strange indeed - I have changed my Ubu 10.10 to Compiz now and the bug does not occur at all... So unfortunately I cannot reproduce it. Yesterday I tried the same in OpenBSD 4.8 with Gnome and no problem there either... EDIT: your attachment contains a binary which should show the problem, but it works fine, no changing of position at all. What version of Compiz are you using? In my case: # compiz --version compiz 0.8.6 What version of GTK and Gnome are you using?
|
|
2lss
Full Member
Posts: 140
|
Post by 2lss on Dec 30, 2010 9:46:50 GMT 1
Strange indeed - I have changed my Ubu 10.10 to Compiz now and the bug does not occur at all... The bug report mentions that the bug appears to be fixed in Maverick, so maybe thats why it works for you. Plus, my compiz version is slightly older (0.8.4). I'm using gtk version 2.20, gnome version 2.30. I'm looking for a compiz backport now. Hopefully that will fix it.
|
|
2lss
Full Member
Posts: 140
|
Post by 2lss on Jan 19, 2011 23:42:39 GMT 1
Sorry about the delay, I have been busy with other stuff (home server ;D) and haven't been working with bacon.
I ended up compiling compiz 0.8.6 on lucid, but for whatever reason, it won't run. So I didn't get a chance to test the bug in my current environment.
I did however try it in Maverick, and the issue is resolved.
|
|
|
Post by Pjot on Jan 21, 2011 15:49:58 GMT 1
Thanks for letting know Best regards Peter
|
|