140 |
if (w->siz_hints.flags & PResizeInc) |
if (w->siz_hints.flags & PResizeInc) |
141 |
NSDebugLLog(@"XGTrace", @"Hint incr %d: %d, %d", |
NSDebugLLog(@"XGTrace", @"Hint incr %d: %d, %d", |
142 |
w->number, w->siz_hints.width_inc, w->siz_hints.height_inc); |
w->number, w->siz_hints.width_inc, w->siz_hints.height_inc); |
143 |
XSetWMNormalHints(d, w->ident, &w->siz_hints); |
if (handlesWindowDecorations |
144 |
|
&& !(w->win_attrs.window_style & NSResizableWindowMask)) |
145 |
|
{ |
146 |
|
/* Some silly window managers (*cough* metacity *cough*) ignore |
147 |
|
our "non-resizable" hints unless we set the min and max |
148 |
|
sizes equal to the current size, hence the ugly code here. */ |
149 |
|
CARD32 oldFlags; |
150 |
|
int old_w0, old_h0, old_w1, old_h1; |
151 |
|
|
152 |
|
old_w0 = w->siz_hints.min_width; |
153 |
|
old_h0 = w->siz_hints.max_width; |
154 |
|
old_w1 = w->siz_hints.min_height; |
155 |
|
old_h1 = w->siz_hints.max_height; |
156 |
|
oldFlags = w->siz_hints.flags; |
157 |
|
|
158 |
|
w->siz_hints.flags |= PMinSize | PMaxSize; |
159 |
|
w->siz_hints.min_width = w->siz_hints.max_width = w->xframe.size.width; |
160 |
|
w->siz_hints.min_height = w->siz_hints.max_height = w->xframe.size.height; |
161 |
|
XSetWMNormalHints(d, w->ident, &w->siz_hints); |
162 |
|
|
163 |
|
w->siz_hints.min_width = old_w0; |
164 |
|
w->siz_hints.max_width = old_h0; |
165 |
|
w->siz_hints.min_height = old_w1; |
166 |
|
w->siz_hints.max_height = old_h1; |
167 |
|
w->siz_hints.flags = oldFlags; |
168 |
|
} |
169 |
|
else |
170 |
|
XSetWMNormalHints(d, w->ident, &w->siz_hints); |
171 |
} |
} |
172 |
|
|
173 |
/* |
/* |
1879 |
XMoveResizeWindow (dpy, window->ident, |
XMoveResizeWindow (dpy, window->ident, |
1880 |
window->siz_hints.x, window->siz_hints.y, |
window->siz_hints.x, window->siz_hints.y, |
1881 |
window->siz_hints.width, window->siz_hints.height); |
window->siz_hints.width, window->siz_hints.height); |
|
setNormalHints(dpy, window); |
|
1882 |
|
|
1883 |
/* Update xframe right away. We optimistically assume that we'll get the |
/* Update xframe right away. We optimistically assume that we'll get the |
1884 |
frame we asked for. If we're right, -gui can update/redraw right away, |
frame we asked for. If we're right, -gui can update/redraw right away, |
1887 |
at that point, we'll send new GSAppKitWindow* events to -gui. */ |
at that point, we'll send new GSAppKitWindow* events to -gui. */ |
1888 |
window->xframe = xVal; |
window->xframe = xVal; |
1889 |
|
|
1890 |
|
/* Update the hints. Note that we do this _after_ updating xframe since |
1891 |
|
the hint setting code needs the new xframe to work around problems |
1892 |
|
with min/max sizes and resizability in some window managers. */ |
1893 |
|
setNormalHints(dpy, window); |
1894 |
|
|
1895 |
if (resize == YES) |
if (resize == YES) |
1896 |
{ |
{ |
1897 |
NSDebugLLog(@"Moving", @"Fake size %d - %@", window->number, |
NSDebugLLog(@"Moving", @"Fake size %d - %@", window->number, |