sync with bb-cvs
This commit is contained in:
parent
b29977196b
commit
300491ce5a
7 changed files with 62 additions and 24 deletions
|
@ -57,8 +57,7 @@ private:
|
||||||
Window window, frame, title;
|
Window window, frame, title;
|
||||||
|
|
||||||
std::string label;
|
std::string label;
|
||||||
int x, y, x_move, y_move, x_shift, y_shift, sublevels, persub, minsub,
|
int x, y, x_move, y_move, x_shift, y_shift, sublevels, persub, minsub;
|
||||||
grab_x, grab_y;
|
|
||||||
unsigned int width, height, title_h, frame_h, item_w, item_h, bevel_w,
|
unsigned int width, height, title_h, frame_h, item_w, item_h, bevel_w,
|
||||||
bevel_h;
|
bevel_h;
|
||||||
} menu;
|
} menu;
|
||||||
|
|
|
@ -35,6 +35,12 @@ extern "C" {
|
||||||
#include "Util.hh"
|
#include "Util.hh"
|
||||||
|
|
||||||
|
|
||||||
|
BGCCacheContext::~BGCCacheContext(void) {
|
||||||
|
if (gc)
|
||||||
|
XFreeGC(display->getXDisplay(), gc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void BGCCacheContext::set(const BColor &_color,
|
void BGCCacheContext::set(const BColor &_color,
|
||||||
const XFontStruct * const _font,
|
const XFontStruct * const _font,
|
||||||
const int _function, const int _subwindow) {
|
const int _function, const int _subwindow) {
|
||||||
|
|
|
@ -39,6 +39,8 @@ public:
|
||||||
const int _function, const int _subwindow);
|
const int _function, const int _subwindow);
|
||||||
void set(const XFontStruct * const _font);
|
void set(const XFontStruct * const _font);
|
||||||
|
|
||||||
|
~BGCCacheContext(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BGCCacheContext(const BaseDisplay * const _display)
|
BGCCacheContext(const BaseDisplay * const _display)
|
||||||
: display(_display), gc(0), pixel(0ul), fontid(0ul),
|
: display(_display), gc(0), pixel(0ul), fontid(0ul),
|
||||||
|
|
|
@ -86,6 +86,9 @@ Slit::~Slit(void) {
|
||||||
|
|
||||||
delete slitmenu;
|
delete slitmenu;
|
||||||
|
|
||||||
|
screen->removeStrut(&strut);
|
||||||
|
screen->updateAvailableArea();
|
||||||
|
|
||||||
screen->getImageControl()->removeImage(frame.pixmap);
|
screen->getImageControl()->removeImage(frame.pixmap);
|
||||||
|
|
||||||
blackbox->removeSlitSearch(frame.window);
|
blackbox->removeSlitSearch(frame.window);
|
||||||
|
|
|
@ -159,8 +159,6 @@ Toolbar::Toolbar(BScreen *scrn) {
|
||||||
frame.base = frame.label = frame.wlabel = frame.clk = frame.button =
|
frame.base = frame.label = frame.wlabel = frame.clk = frame.button =
|
||||||
frame.pbutton = None;
|
frame.pbutton = None;
|
||||||
|
|
||||||
screen->addStrut(&strut);
|
|
||||||
|
|
||||||
reconfigure();
|
reconfigure();
|
||||||
mapToolbar();
|
mapToolbar();
|
||||||
}
|
}
|
||||||
|
@ -203,6 +201,7 @@ void Toolbar::mapToolbar() {
|
||||||
XMapSubwindows(display, frame.window);
|
XMapSubwindows(display, frame.window);
|
||||||
XMapWindow(display, frame.window);
|
XMapWindow(display, frame.window);
|
||||||
}
|
}
|
||||||
|
screen->addStrut(&strut);
|
||||||
updateStrut();
|
updateStrut();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,6 +210,9 @@ void Toolbar::unmapToolbar() {
|
||||||
if (toolbarmenu->isVisible())
|
if (toolbarmenu->isVisible())
|
||||||
toolbarmenu->hide();
|
toolbarmenu->hide();
|
||||||
//hidden so we can maximize over the toolbar
|
//hidden so we can maximize over the toolbar
|
||||||
|
screen->removeStrut(&strut);
|
||||||
|
screen->updateAvailableArea();
|
||||||
|
|
||||||
XUnmapWindow(display, frame.window);
|
XUnmapWindow(display, frame.window);
|
||||||
updateStrut();
|
updateStrut();
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,8 +273,6 @@ BlackboxWindow::BlackboxWindow(Blackbox *b, Window w, BScreen *s) {
|
||||||
}
|
}
|
||||||
#endif // SHAPE
|
#endif // SHAPE
|
||||||
|
|
||||||
grabButtons();
|
|
||||||
|
|
||||||
windowmenu = new Windowmenu(this);
|
windowmenu = new Windowmenu(this);
|
||||||
|
|
||||||
if (blackbox_attrib.workspace >= screen->getWorkspaceCount())
|
if (blackbox_attrib.workspace >= screen->getWorkspaceCount())
|
||||||
|
@ -338,6 +336,7 @@ BlackboxWindow::BlackboxWindow(Blackbox *b, Window w, BScreen *s) {
|
||||||
|
|
||||||
positionWindows();
|
positionWindows();
|
||||||
decorate();
|
decorate();
|
||||||
|
grabButtons();
|
||||||
|
|
||||||
XMapSubwindows(blackbox->getXDisplay(), frame.window);
|
XMapSubwindows(blackbox->getXDisplay(), frame.window);
|
||||||
|
|
||||||
|
@ -818,12 +817,13 @@ void BlackboxWindow::positionButtons(bool redecorate_label) {
|
||||||
|
|
||||||
void BlackboxWindow::reconfigure(void) {
|
void BlackboxWindow::reconfigure(void) {
|
||||||
upsize();
|
upsize();
|
||||||
|
|
||||||
positionWindows();
|
positionWindows();
|
||||||
decorate();
|
decorate();
|
||||||
|
|
||||||
redrawWindowFrame();
|
redrawWindowFrame();
|
||||||
|
|
||||||
|
ungrabButtons();
|
||||||
|
grabButtons();
|
||||||
|
|
||||||
if (windowmenu) {
|
if (windowmenu) {
|
||||||
windowmenu->move(windowmenu->getX(), frame.rect.y() + frame.title_h);
|
windowmenu->move(windowmenu->getX(), frame.rect.y() + frame.title_h);
|
||||||
windowmenu->reconfigure();
|
windowmenu->reconfigure();
|
||||||
|
@ -879,10 +879,8 @@ void BlackboxWindow::positionWindows(void) {
|
||||||
XMoveResizeWindow(blackbox->getXDisplay(), client.window,
|
XMoveResizeWindow(blackbox->getXDisplay(), client.window,
|
||||||
0, 0, client.rect.width(), client.rect.height());
|
0, 0, client.rect.width(), client.rect.height());
|
||||||
// ensure client.rect contains the real location
|
// ensure client.rect contains the real location
|
||||||
client.rect.setCoords(frame.rect.left() + frame.margin.left,
|
client.rect.setPos(frame.rect.left() + frame.margin.left,
|
||||||
frame.rect.top() + frame.margin.top,
|
frame.rect.top() + frame.margin.top);
|
||||||
frame.rect.right() - frame.margin.right,
|
|
||||||
frame.rect.bottom() - frame.margin.bottom);
|
|
||||||
|
|
||||||
if (decorations & Decor_Titlebar) {
|
if (decorations & Decor_Titlebar) {
|
||||||
if (frame.title == None) createTitlebar();
|
if (frame.title == None) createTitlebar();
|
||||||
|
@ -925,6 +923,7 @@ void BlackboxWindow::positionWindows(void) {
|
||||||
} else if (frame.handle) {
|
} else if (frame.handle) {
|
||||||
destroyHandle();
|
destroyHandle();
|
||||||
}
|
}
|
||||||
|
XSync(blackbox->getXDisplay(), False);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1112,6 +1111,11 @@ void BlackboxWindow::getWMNormalHints(void) {
|
||||||
client.min_width = client.min_height =
|
client.min_width = client.min_height =
|
||||||
client.width_inc = client.height_inc = 1;
|
client.width_inc = client.height_inc = 1;
|
||||||
client.base_width = client.base_height = 0;
|
client.base_width = client.base_height = 0;
|
||||||
|
client.win_gravity = NorthWestGravity;
|
||||||
|
#if 0
|
||||||
|
client.min_aspect_x = client.min_aspect_y =
|
||||||
|
client.max_aspect_x = client.max_aspect_y = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
use the full screen, not the strut modified size. otherwise when the
|
use the full screen, not the strut modified size. otherwise when the
|
||||||
|
@ -1120,11 +1124,7 @@ void BlackboxWindow::getWMNormalHints(void) {
|
||||||
*/
|
*/
|
||||||
const Rect& screen_area = screen->getRect();
|
const Rect& screen_area = screen->getRect();
|
||||||
client.max_width = screen_area.width();
|
client.max_width = screen_area.width();
|
||||||
|
|
||||||
client.max_height = screen_area.height();
|
client.max_height = screen_area.height();
|
||||||
client.min_aspect_x = client.min_aspect_y =
|
|
||||||
client.max_aspect_x = client.max_aspect_y = 1;
|
|
||||||
client.win_gravity = NorthWestGravity;
|
|
||||||
|
|
||||||
if (! XGetWMNormalHints(blackbox->getXDisplay(), client.window,
|
if (! XGetWMNormalHints(blackbox->getXDisplay(), client.window,
|
||||||
&sizehint, &icccm_mask))
|
&sizehint, &icccm_mask))
|
||||||
|
@ -1133,13 +1133,22 @@ void BlackboxWindow::getWMNormalHints(void) {
|
||||||
client.normal_hint_flags = sizehint.flags;
|
client.normal_hint_flags = sizehint.flags;
|
||||||
|
|
||||||
if (sizehint.flags & PMinSize) {
|
if (sizehint.flags & PMinSize) {
|
||||||
client.min_width = sizehint.min_width;
|
if (sizehint.min_width >= 0)
|
||||||
client.min_height = sizehint.min_height;
|
client.min_width = sizehint.min_width;
|
||||||
|
if (sizehint.min_height >= 0)
|
||||||
|
client.min_height = sizehint.min_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sizehint.flags & PMaxSize) {
|
if (sizehint.flags & PMaxSize) {
|
||||||
client.max_width = sizehint.max_width;
|
if (sizehint.max_width > static_cast<signed>(client.min_width))
|
||||||
client.max_height = sizehint.max_height;
|
client.max_width = sizehint.max_width;
|
||||||
|
else
|
||||||
|
client.max_width = client.min_width;
|
||||||
|
|
||||||
|
if (sizehint.max_height > static_cast<signed>(client.min_height))
|
||||||
|
client.max_height = sizehint.max_height;
|
||||||
|
else
|
||||||
|
client.max_height = client.min_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sizehint.flags & PResizeInc) {
|
if (sizehint.flags & PResizeInc) {
|
||||||
|
@ -1147,12 +1156,14 @@ void BlackboxWindow::getWMNormalHints(void) {
|
||||||
client.height_inc = sizehint.height_inc;
|
client.height_inc = sizehint.height_inc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 // we do not support this at the moment
|
||||||
if (sizehint.flags & PAspect) {
|
if (sizehint.flags & PAspect) {
|
||||||
client.min_aspect_x = sizehint.min_aspect.x;
|
client.min_aspect_x = sizehint.min_aspect.x;
|
||||||
client.min_aspect_y = sizehint.min_aspect.y;
|
client.min_aspect_y = sizehint.min_aspect.y;
|
||||||
client.max_aspect_x = sizehint.max_aspect.x;
|
client.max_aspect_x = sizehint.max_aspect.x;
|
||||||
client.max_aspect_y = sizehint.max_aspect.y;
|
client.max_aspect_y = sizehint.max_aspect.y;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (sizehint.flags & PBaseSize) {
|
if (sizehint.flags & PBaseSize) {
|
||||||
client.base_width = sizehint.base_width;
|
client.base_width = sizehint.base_width;
|
||||||
|
@ -1445,7 +1456,8 @@ BlackboxWindow *BlackboxWindow::getTransientFor(void) const {
|
||||||
*/
|
*/
|
||||||
void BlackboxWindow::configure(int dx, int dy,
|
void BlackboxWindow::configure(int dx, int dy,
|
||||||
unsigned int dw, unsigned int dh) {
|
unsigned int dw, unsigned int dh) {
|
||||||
bool send_event = (frame.rect.x() != dx || frame.rect.y() != dy);
|
bool send_event = ((frame.rect.x() != dx || frame.rect.y() != dy) &&
|
||||||
|
! flags.moving);
|
||||||
|
|
||||||
if (dw != frame.rect.width() || dh != frame.rect.height()) {
|
if (dw != frame.rect.width() || dh != frame.rect.height()) {
|
||||||
frame.rect.setRect(dx, dy, dw, dh);
|
frame.rect.setRect(dx, dy, dw, dh);
|
||||||
|
@ -1474,9 +1486,15 @@ void BlackboxWindow::configure(int dx, int dy,
|
||||||
|
|
||||||
XMoveWindow(blackbox->getXDisplay(), frame.window,
|
XMoveWindow(blackbox->getXDisplay(), frame.window,
|
||||||
frame.rect.x(), frame.rect.y());
|
frame.rect.x(), frame.rect.y());
|
||||||
|
/*
|
||||||
|
we may have been called just after an opaque window move, so even though
|
||||||
|
the old coords match the new ones no ConfigureNotify has been sent yet.
|
||||||
|
There are likely other times when this will be relevant as well.
|
||||||
|
*/
|
||||||
|
if (! flags.moving) send_event = True;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (send_event && ! flags.moving) {
|
if (send_event) {
|
||||||
// if moving, the update and event will occur when the move finishes
|
// if moving, the update and event will occur when the move finishes
|
||||||
client.rect.setPos(frame.rect.left() + frame.margin.left,
|
client.rect.setPos(frame.rect.left() + frame.margin.left,
|
||||||
frame.rect.top() + frame.margin.top);
|
frame.rect.top() + frame.margin.top);
|
||||||
|
@ -1498,6 +1516,7 @@ void BlackboxWindow::configure(int dx, int dy,
|
||||||
XSendEvent(blackbox->getXDisplay(), client.window, False,
|
XSendEvent(blackbox->getXDisplay(), client.window, False,
|
||||||
StructureNotifyMask, &event);
|
StructureNotifyMask, &event);
|
||||||
screen->updateNetizenConfigNotify(&event);
|
screen->updateNetizenConfigNotify(&event);
|
||||||
|
XFlush(blackbox->getXDisplay());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1593,6 +1612,7 @@ bool BlackboxWindow::setInputFocus(void) {
|
||||||
ce.xclient.data.l[4] = 0l;
|
ce.xclient.data.l[4] = 0l;
|
||||||
XSendEvent(blackbox->getXDisplay(), client.window, False,
|
XSendEvent(blackbox->getXDisplay(), client.window, False,
|
||||||
NoEventMask, &ce);
|
NoEventMask, &ce);
|
||||||
|
XFlush(blackbox->getXDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1709,6 +1729,7 @@ void BlackboxWindow::close(void) {
|
||||||
ce.xclient.data.l[3] = 0l;
|
ce.xclient.data.l[3] = 0l;
|
||||||
ce.xclient.data.l[4] = 0l;
|
ce.xclient.data.l[4] = 0l;
|
||||||
XSendEvent(blackbox->getXDisplay(), client.window, False, NoEventMask, &ce);
|
XSendEvent(blackbox->getXDisplay(), client.window, False, NoEventMask, &ce);
|
||||||
|
XFlush(blackbox->getXDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2601,8 +2622,11 @@ void BlackboxWindow::propertyNotifyEvent(const XPropertyEvent *pe) {
|
||||||
decorations &= ~(Decor_Maximize | Decor_Handle);
|
decorations &= ~(Decor_Maximize | Decor_Handle);
|
||||||
functions &= ~(Func_Resize | Func_Maximize);
|
functions &= ~(Func_Resize | Func_Maximize);
|
||||||
} else {
|
} else {
|
||||||
decorations |= Decor_Maximize | Decor_Handle;
|
if (! isTransient()) {
|
||||||
functions |= Func_Resize | Func_Maximize;
|
decorations |= Decor_Maximize | Decor_Handle;
|
||||||
|
functions |= Func_Maximize;
|
||||||
|
}
|
||||||
|
functions |= Func_Resize;
|
||||||
}
|
}
|
||||||
grabButtons();
|
grabButtons();
|
||||||
setAllowedActions();
|
setAllowedActions();
|
||||||
|
|
|
@ -176,8 +176,10 @@ private:
|
||||||
min_width, min_height, // can not be resized smaller
|
min_width, min_height, // can not be resized smaller
|
||||||
max_width, max_height, // can not be resized larger
|
max_width, max_height, // can not be resized larger
|
||||||
width_inc, height_inc, // increment step
|
width_inc, height_inc, // increment step
|
||||||
|
#if 0 // not supported at the moment
|
||||||
min_aspect_x, min_aspect_y, // minimum aspect ratio
|
min_aspect_x, min_aspect_y, // minimum aspect ratio
|
||||||
max_aspect_x, max_aspect_y, // maximum aspect ratio
|
max_aspect_x, max_aspect_y, // maximum aspect ratio
|
||||||
|
#endif
|
||||||
base_width, base_height,
|
base_width, base_height,
|
||||||
win_gravity;
|
win_gravity;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue