After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 120756 - gok main menu shrinking
gok main menu shrinking
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
unspecified
Other Solaris
: High major
: METACITY2.6.x
Assigned To: Metacity maintainers list
Metacity maintainers list
AP1
Depends on: 123838
Blocks:
 
 
Reported: 2003-08-26 14:38 UTC by david.hawthorne
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.3/2.4


Attachments
Debug patch (1.93 KB, patch)
2003-09-09 08:54 UTC, padraig.obriain
none Details | Review

Description david.hawthorne 2003-08-26 14:38:31 UTC
using gnome-2.4 nightly from 26/08/03

.logged in as normal user.

It appears that if GOK displays a UI Grab menu with a large number of
buttons, when it reverts back to main the window has got smaller. If you
return to the same largely populated UI Grab menu and revert again, the
main menu is smaller still.  
e.g.
- run StarOffice
- run GOK
- launch a new text document
- hit UI Grab and a large number of widgtes are available
- click back to go to main menu, and it has shrunk smaller, even as far as
making the buttons illegible.
Comment 1 David Bolter 2003-08-26 14:43:56 UTC
Is the largely populated UI keyboard taking up your entire screen width?
Comment 2 david.hawthorne 2003-08-26 15:03:21 UTC
No it isn't taking up the whole screen but it is right on the left
boundary of the screen. I've reproduced it with selecting 'toolbars'
too, and clicking back to main. Doing this repeatedly decreases the
menu size, and also the size of other gok features like the composer
keyboard.
Comment 3 David Bolter 2003-08-28 19:00:32 UTC
Bumping up priority, but I can't confirm this bug.  Anyone else using
a recent Solaris gnome environment?
Comment 4 padraig.obriain 2003-08-29 07:55:50 UTC
I see the gok window getting snaller when I use gok with gedit. I will
investigate.
Comment 5 padraig.obriain 2003-08-29 10:49:28 UTC
I set the key width to 40 and key height to 100 and placed the
"GOK-main" window in the top right hand corner of the screen.
I then pressed Activate. This moved the window to the center of the
screen and the key width was reduced to 18. After pressing Back the
key width remained at 18. Pressing Activate again reduced the key
width to 16. After pressing Back And Activate again the key width was
now 13.

This seems to be reproducible, for me at least. It may depend on what
windows I have open. I have shown it to Bill so I have a reliable
witness!
Comment 6 bill.haneman 2003-09-04 22:25:35 UTC
I do not see this bug on Linux.  I have tried reproducing it for
awhile but to no effect.
Comment 7 padraig.obriain 2003-09-05 16:20:42 UTC
I have looked at this and wht I have seen is thatg the call to
gdk_window_move_resize() in main.c results in a XMoveResize call with
values (15, 0, 1257, 321) for (x, y, width, height)

When a ConfigureNotify event occurs the values are (4, 19, 397, 321).

Any suggestions about what could cause the window size and position to
change?
Comment 8 padraig.obriain 2003-09-08 11:04:06 UTC
I think that the problem is interaction with metacity. I hope to have
more specific information later today.
Comment 9 padraig.obriain 2003-09-08 14:45:57 UTC
The function meta_window_configure_request is called in metacity for
the ConfigureRequest event. This calls
meta_window_move-resize_internal which calls meta_window_constrain
which causes the requested size to be changed.

I do not see any obvious fix.

Can someone explain how this ought to work?
Comment 10 Havoc Pennington 2003-09-08 17:04:46 UTC
when you say "meta_window_constrain which causes the requested size to
be changed" I think you're kind of skipping all the interesting
information. ;-) i.e. why does it cause the size to be changed.

metacity verbose log (and maybe adding more debug spew to constrain.c)
may turn up an answer. There's a huge comment on the top of
constrain.c explaining how the file works.
Comment 11 padraig.obriain 2003-09-09 08:54:37 UTC
Created attachment 19820 [details] [review]
Debug patch
Comment 12 padraig.obriain 2003-09-09 08:59:30 UTC
I applied the attached bug patch to constraints.c and got the
following output:

Constraining 0xd80002 (GOK - Wind) x_move_delta = -568 y_move_delta =
-21 x_direction = 2 y_direction = 2 x_delta = 572 y_delta = 43 orig
963,53 309x126
At 1410 in constraints.c 963 53 309 126
At 1427 in constraints.c 963 53 551 126
At 1446 in constraints.c 963 53 551 169
At 1450 in constraints.c 395 53 551 169


The problem seems to be that calling constrain_resize_right before
constrain_move changes the size of the window. The window was
originally at the top right hand corner of the screen and it looks
like constrain_resize_right find therre is not enough room for the
window and so changes its size.

If I call constrain_move first it wqorks for my case.

It is not clear what the criteria should be for calling constrain_move
first.
Comment 13 bill.haneman 2003-09-19 12:38:08 UTC
Havoc:  if you look up in this thread you will see that the
application API call which is generating bad results is
'gdk_window_move_resize'; it seems from Padraig's description that
gdk_window_move_resize is sometimes failing to relocate to a 'valid'
onscreen position.  IOW, metacity constrains its size unnecessarily
because the 'move' component causes the newly-requested onscreen
coords to be within the available screen real-estate. 
gdk_window_move_resize just calls XMoveResizeWindow, so it's not clear
to me why/if metacity tries to do the resize logic first.

I guess doing our own logic and calling gdk_window_move prior to
gdk_window_resize (sometimes!  and other times doing the reverse)
might work around the problem, but GDK clearly recommends using
move_resize when both operations are being performed in response to
the same application action.

It looks as though Padraig has identified a case where constrain.c
does not work as it should; hp can you please help investigate?  Thanks
Comment 14 Havoc Pennington 2003-09-19 15:32:16 UTC
Rob, what is the bug # with all the discussion of whether to move or
resize first?
Comment 15 Rob Adams 2003-09-19 15:43:43 UTC
Bug 106740.

-Rob
Comment 16 bill.haneman 2003-09-19 16:05:54 UTC
yes, it does look as though this is a side-effect of the code changes
for bug 106740.

Comment 17 Havoc Pennington 2003-09-25 01:38:01 UTC
Random brainstorm - is there some way to detect the case where we want
to move first vs. the case where we want to resize first?

I've thought about it no further than that sentence. ;-)
Comment 18 padraig.obriain 2003-09-26 10:05:32 UTC
If the window is being moved backwards and its size is being increased
I think we want to move first. I think that if we applied this for x
direction it would fix the current problem.
Comment 19 Rob Adams 2003-10-07 02:36:02 UTC
it is my sincere hope that this is fixed in CVS.  The fix will be in
the upcoming Gnome 2.4.1 release shortly after Oct 13 or thereabouts.
Comment 20 padraig.obriain 2003-10-07 07:48:31 UTC
It looks to me that this bug is fixed in metacity from CVS HEAD.
Comment 21 padraig.obriain 2003-10-07 10:39:35 UTC
It seems that I cannot move a window whose height is greater than the
screen height off the top of the screen. See bug 106740. Should I open
a new bug about that?
Comment 22 bill.haneman 2003-10-07 11:45:47 UTC
Padraig: please reopen bug 106740.
Comment 23 Rob Adams 2003-10-07 15:38:48 UTC
you can only do that if 1) the window is undecorated, or 2) the
window's _minimum_ size won't fit on the screen.  So if the window can
be resized to fit, it still enforces the onscreen top constraint. 
Reopen 106740 only if these conditions aren't working.