sync with bb-cvs

This commit is contained in:
Dana Jansens 2002-05-28 09:53:11 +00:00
parent 6284d4ef90
commit 57ac5e5b5e
2 changed files with 49 additions and 13 deletions

View file

@ -1070,6 +1070,13 @@ void BScreen::unmanageWindow(BlackboxWindow *w, bool remap) {
removeNetizen(w->getClientWindow()); removeNetizen(w->getClientWindow());
/*
some managed windows can also be window group controllers. when
unmanaging such windows, we should also delete the window group.
*/
BWindowGroup *group = blackbox->searchGroup(w->getClientWindow());
delete group;
delete w; delete w;
} }

View file

@ -805,9 +805,10 @@ void BlackboxWindow::positionWindows(void) {
XSetWindowBorderWidth(blackbox->getXDisplay(), frame.right_grip, XSetWindowBorderWidth(blackbox->getXDisplay(), frame.right_grip,
frame.border_w); frame.border_w);
// use client.rect here so the value is correct even if shaded
XMoveResizeWindow(blackbox->getXDisplay(), frame.handle, XMoveResizeWindow(blackbox->getXDisplay(), frame.handle,
-frame.border_w, -frame.border_w,
frame.rect.height() - frame.margin.bottom + client.rect.height() + frame.margin.top +
frame.mwm_border_w - frame.border_w, frame.mwm_border_w - frame.border_w,
frame.inside_w, frame.handle_h); frame.inside_w, frame.handle_h);
XMoveResizeWindow(blackbox->getXDisplay(), frame.left_grip, XMoveResizeWindow(blackbox->getXDisplay(), frame.left_grip,
@ -816,6 +817,7 @@ void BlackboxWindow::positionWindows(void) {
XMoveResizeWindow(blackbox->getXDisplay(), frame.right_grip, XMoveResizeWindow(blackbox->getXDisplay(), frame.right_grip,
frame.inside_w - frame.grip_w - frame.border_w, frame.inside_w - frame.grip_w - frame.border_w,
-frame.border_w, frame.grip_w, frame.handle_h); -frame.border_w, frame.grip_w, frame.handle_h);
XMapSubwindows(blackbox->getXDisplay(), frame.handle); XMapSubwindows(blackbox->getXDisplay(), frame.handle);
XMapWindow(blackbox->getXDisplay(), frame.handle); XMapWindow(blackbox->getXDisplay(), frame.handle);
} else if (frame.handle) { } else if (frame.handle) {
@ -1501,7 +1503,9 @@ void BlackboxWindow::maximize(unsigned int button) {
blackbox_attrib.premax_x = frame.rect.x(); blackbox_attrib.premax_x = frame.rect.x();
blackbox_attrib.premax_y = frame.rect.y(); blackbox_attrib.premax_y = frame.rect.y();
blackbox_attrib.premax_w = frame.rect.width(); blackbox_attrib.premax_w = frame.rect.width();
blackbox_attrib.premax_h = frame.rect.height(); // use client.rect so that clients can be restored even if shaded
blackbox_attrib.premax_h =
client.rect.height() + frame.margin.top + frame.margin.bottom;
const Rect &screen_area = screen->availableArea(); const Rect &screen_area = screen->availableArea();
frame.changing = screen_area; frame.changing = screen_area;
@ -2865,13 +2869,23 @@ void BlackboxWindow::upsize(void) {
frame.margin.bottom = frame.border_w + frame.mwm_border_w; frame.margin.bottom = frame.border_w + frame.mwm_border_w;
} }
// set the frame rect /*
frame.rect.setSize(client.rect.width() + frame.margin.left + We first get the normal dimensions and use this to define the inside_w/h
frame.margin.right, then we modify the height if shading is in effect.
client.rect.height() + frame.margin.top + If the shade state is not considered then frame.rect gets reset to the
frame.margin.bottom); normal window size on a reconfigure() call resulting in improper
frame.inside_w = frame.rect.width() - (frame.border_w * 2); dimensions appearing in move/resize and other events.
frame.inside_h = frame.rect.height() - (frame.border_w * 2); */
unsigned int
height = client.rect.height() + frame.margin.top + frame.margin.bottom,
width = client.rect.width() + frame.margin.left + frame.margin.right;
frame.inside_w = width - (frame.border_w * 2);
frame.inside_h = height - (frame.border_w * 2);
if (flags.shaded)
height = frame.title_h + (frame.border_w * 2);
frame.rect.setSize(width, height);
} }
@ -2881,8 +2895,7 @@ void BlackboxWindow::upsize(void) {
* *
* The logical width and height are placed into pw and ph, if they * The logical width and height are placed into pw and ph, if they
* are non-zero. Logical size refers to the users perception of * are non-zero. Logical size refers to the users perception of
* the window size (for example an xterm has resizes in cells, not in * the window size (for example an xterm resizes in cells, not in pixels).
* pixels).
* *
* The physical geometry is placed into frame.changing_{x,y,width,height}. * The physical geometry is placed into frame.changing_{x,y,width,height}.
* Physical geometry refers to the geometry of the window in pixels. * Physical geometry refers to the geometry of the window in pixels.
@ -2978,8 +2991,24 @@ int WindowStyle::doJustify(const char *text, int &start_pos,
BWindowGroup::BWindowGroup(Blackbox *b, Window _group) BWindowGroup::BWindowGroup(Blackbox *b, Window _group)
: blackbox(b), group(_group) { : blackbox(b), group(_group) {
// watch for destroy notify on the group window XWindowAttributes wattrib;
XSelectInput(blackbox->getXDisplay(), group, StructureNotifyMask); if (! XGetWindowAttributes(blackbox->getXDisplay(), group, &wattrib)) {
// group window doesn't seem to exist anymore
delete this;
return;
}
/*
watch for destroy notify on the group window (in addition to
any other events we are looking for)
since some managed windows can also be window group controllers,
we need to make sure that we don't clobber the event mask for the
managed window
*/
XSelectInput(blackbox->getXDisplay(), group,
wattrib.your_event_mask | StructureNotifyMask);
blackbox->saveGroupSearch(group, this); blackbox->saveGroupSearch(group, this);
} }