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 52833 - resize grips for all corners
resize grips for all corners
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
1.3.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 96832
 
 
Reported: 2001-04-03 17:50 UTC by Havoc Pennington
Modified: 2011-02-04 16:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix (3.52 KB, patch)
2002-02-14 02:08 UTC, Anders Carlsson
none Details | Review
Patch to implement grippy drawing (5.90 KB, patch)
2002-10-28 12:18 UTC, Anders Carlsson
none Details | Review
patch (10.93 KB, patch)
2002-10-28 21:51 UTC, Matthias Clasen
none Details | Review
patch (2.65 KB, patch)
2002-11-10 01:40 UTC, Matthias Clasen
none Details | Review
patch (5.25 KB, patch)
2002-11-11 23:26 UTC, Matthias Clasen
none Details | Review

Description Havoc Pennington 2001-04-03 17:50:42 UTC
in gtkstyle.c and the gdk code that emulates resizing on lame wm's, only
lower-right grips are handled
Comment 1 Anders Carlsson 2002-02-14 02:08:45 UTC
Created attachment 6713 [details] [review]
Fix
Comment 2 Owen Taylor 2002-02-21 19:52:20 UTC
The patch only does the GDK part, not the gtkstyle.c part.
Comment 3 Anders Carlsson 2002-02-21 22:34:47 UTC
Yes, so I've been told :)

I'll try to fix it this weekend if it's OK.
Comment 4 Owen Taylor 2002-03-02 20:33:01 UTC
Also, need test case... might be neat to have testgtk test
which drew grips on all corners of a window and allowed resizing
from all of them.
Comment 5 Matthias Clasen 2002-04-05 13:34:47 UTC
Move open bugs from milestones 2.0.[012] -- > 2.0.3, since 2.0.2 is already out.
Comment 6 Owen Taylor 2002-10-24 17:00:38 UTC
Moving some hard to fix bugs onto 2.4.0 milestone.
Comment 7 Matthias Clasen 2002-10-28 07:49:12 UTC
Anders, do you have any code to handle the other corners in gtkstyle.c ? The reason I'm 
asking is that I tried to implement RTL flipping for status bars (bug 96832), but I'm 
lacking the artistic talent to draw good-looking resize grips for the south-west 
corner.
Comment 8 Anders Carlsson 2002-10-28 12:17:41 UTC
I have code that handles SW, S and SE. Let me attach the patch.
Comment 9 Anders Carlsson 2002-10-28 12:18:25 UTC
Created attachment 11885 [details] [review]
Patch to implement grippy drawing
Comment 10 Matthias Clasen 2002-10-28 21:50:22 UTC
Thanks. I've extended the code to handle the remaining edges.
Comment 11 Matthias Clasen 2002-10-28 21:51:26 UTC
Created attachment 11890 [details] [review]
patch
Comment 12 Owen Taylor 2002-11-01 23:28:01 UTC
The drawing patch looks fine to me to me; the resize-emulation
patch is going to need updating for multihead and GTK+-2.2.
Comment 13 Matthias Clasen 2002-11-02 00:19:51 UTC
Drawing patch committed now.
Comment 14 Owen Taylor 2002-11-02 03:40:41 UTC
Note for whoever works on the rest - the testgtk addition
hasn't been committed, and should definitely go in.
Comment 15 Anders Carlsson 2002-11-03 22:14:59 UTC
I also think resize-emulation is broken for N, NW and NE.
Comment 16 Anders Carlsson 2002-11-07 10:09:49 UTC
I've committed the testgtk code for this.
Comment 17 Matthias Clasen 2002-11-09 00:25:33 UTC
Resize emulation is completely broken currently. Doesn't work on any
corner. I tried it with blackbox and twm. Any ideas what needs to be
changed here ?
Comment 18 Matthias Clasen 2002-11-10 01:39:24 UTC
I've fixed the typo which broke emulation.
Here is a patch which seems to work for the other edges.
Comment 19 Matthias Clasen 2002-11-10 01:40:03 UTC
Created attachment 12205 [details] [review]
patch
Comment 20 Owen Taylor 2002-11-10 15:02:08 UTC
Patch mostly looks reasonable. Does it work right if the application
has changed the resize gravity of the window 
using gdk_window_set_geometry_hints? It seems to me, for example,
that if the window's gravity was static, you'd want
get_origin(), not get_root_origin().
Comment 21 Matthias Clasen 2002-11-10 22:54:37 UTC
Testing reveals that you want to use get_origin () instead of
get_root_origin () in all cases. Otherwise, press-release cycles
on a resize grip give you jumping windows. But with get_origin ()
to code works with all gravities (tested on both blackbox and twm).
Comment 22 Matthias Clasen 2002-11-11 19:24:46 UTC
I spoke too soon. Things appeared to work, because twm and blackbox
don't properly compute the reference point as explained in the EWMH.
Testing the emulation code with metacity shows jumping windows for all
gravitys but static.

So I tried to fix this by using the reference point as
moveresize_orig_x, moveresize_orig_y (should't there be a 
gdk_window_get_reference_point (GdkWindow *window, gint *x, gint *y) ?

But this doesn't help. What makes me wonder is that xwininfo still
reports 
Window Gravity State: NorthWestGravity
even after I called gtk_window_set_gravity () on the window...
Comment 23 Owen Taylor 2002-11-11 20:27:06 UTC
Remember that window gravity is different than resize
gravity as defined in the ICCCM. You want 'xprop',
not 'xwininfo'
Comment 24 Matthias Clasen 2002-11-11 21:40:46 UTC
Yea, remembered that shortly after writing above comment. 
Comment 25 Matthias Clasen 2002-11-11 23:25:09 UTC
Ok, finally produced a patch that works with all gravities and all WMs
with fully ICCCM-compliant reference point handling. I've tested this
with Metacity. Unfortunately, these WMs are likely to implement
_NET_WM_MOVERESIZE and don't need emulation anyway. twm and blackbox
both exhibit jumping windows with this patch (even for NorthWest
gravity, which is sad). But I think there is no real alternative to 
assuming ICCCM compliance, since the legacy WMs have probably all
different bugs in the reference point handling. 
Comment 26 Matthias Clasen 2002-11-11 23:26:19 UTC
Created attachment 12245 [details] [review]
patch
Comment 27 Matthias Clasen 2002-11-12 00:10:35 UTC
The patch is not perfect though, even for metacity. Occasionally you
can see edges wiggle around a bit which are supposed to stay put. E.g
when 
dragging the north edge with gravity center, the south edge moves up
and down by a few pixels. This may be due to the metacity
implementation of moveresize or just rounding errors, don't know.
Comment 28 Havoc Pennington 2002-11-12 00:27:03 UTC
Metacity isn't using emulation mode, is it? So the confusion is just a
metacity bug.

Note that metacity will get confused if you try to resize a window off
the top of the screen. It will constrain the window position but won't
then compensate by decreasing the resize, result is moving the
window's bottom edge downward. This is what the new constraints.c code
is supposed to fix someday. There are a bunch of comments in there
that attempt to explain it.
Comment 29 Matthias Clasen 2002-11-12 07:34:11 UTC
I forced testgtk to use emulation with all WMs for testing purposes.
I noticed the 
fun effect you describe for the top edge also on the left edge.
Comment 30 Matthias Clasen 2002-11-12 08:12:43 UTC
Maybe the only way to make this work perfectly would be to temporarily change the 
window geometry so that we can get the desired effect without moving at all, just be 
resizing. But

a) I don't know if gdk is supposed to muck with window geometry
b) 
it would probably be even more broken with legacy wms.
Comment 31 Owen Taylor 2002-12-03 15:24:55 UTC
The one suggestion I'd make here is that we probably should
special case the south-east case to make it a pure resize
rather than a move-resize, so at least we can avoid triggering
WM bugs in that most common case.

Other than that, the patch looks fine to me.
Comment 32 Matthias Clasen 2002-12-03 22:00:48 UTC
Since I'm not entirely sure how to implement this best (temporarily
changing window gravity ?), I have commmitted the patch as is for now.
We can improve the emulation if it turns out to be a problem.