sync with bb cvs
This commit is contained in:
parent
4787715525
commit
23640740ca
4 changed files with 19 additions and 20 deletions
|
@ -91,12 +91,11 @@ using std::string;
|
||||||
// X error handler to handle any and all X errors while the application is
|
// X error handler to handle any and all X errors while the application is
|
||||||
// running
|
// running
|
||||||
static bool internal_error = False;
|
static bool internal_error = False;
|
||||||
static Window last_bad_window = None;
|
|
||||||
|
|
||||||
BaseDisplay *base_display;
|
BaseDisplay *base_display;
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
static int handleXErrors(Display *d, XErrorEvent *e) {
|
static int handleXErrors(Display *d, XErrorEvent *e) {
|
||||||
|
#ifdef DEBUG
|
||||||
char errtxt[128];
|
char errtxt[128];
|
||||||
|
|
||||||
XGetErrorText(d, e->error_code, errtxt, 128);
|
XGetErrorText(d, e->error_code, errtxt, 128);
|
||||||
|
@ -106,10 +105,11 @@ static int handleXErrors(Display *d, XErrorEvent *e) {
|
||||||
base_display->getApplicationName(), errtxt, e->error_code,
|
base_display->getApplicationName(), errtxt, e->error_code,
|
||||||
e->request_code, e->minor_code, e->resourceid);
|
e->request_code, e->minor_code, e->resourceid);
|
||||||
#else
|
#else
|
||||||
static int handleXErrors(Display *, XErrorEvent *e) {
|
// shutup gcc
|
||||||
|
(void) d;
|
||||||
|
(void) e;
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
|
|
||||||
if (e->error_code == BadWindow) last_bad_window = e->resourceid;
|
|
||||||
if (internal_error) abort();
|
if (internal_error) abort();
|
||||||
|
|
||||||
return(False);
|
return(False);
|
||||||
|
@ -179,7 +179,6 @@ BaseDisplay::BaseDisplay(const char *app_name, const char *dpy_name) {
|
||||||
application_name = app_name;
|
application_name = app_name;
|
||||||
|
|
||||||
run_state = STARTUP;
|
run_state = STARTUP;
|
||||||
last_bad_window = None;
|
|
||||||
|
|
||||||
::base_display = this;
|
::base_display = this;
|
||||||
|
|
||||||
|
@ -302,11 +301,6 @@ void BaseDisplay::eventLoop(void) {
|
||||||
if (XPending(display)) {
|
if (XPending(display)) {
|
||||||
XEvent e;
|
XEvent e;
|
||||||
XNextEvent(display, &e);
|
XNextEvent(display, &e);
|
||||||
|
|
||||||
if (last_bad_window != None && e.xany.window == last_bad_window)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
last_bad_window = None;
|
|
||||||
process_event(&e);
|
process_event(&e);
|
||||||
} else {
|
} else {
|
||||||
fd_set rfds;
|
fd_set rfds;
|
||||||
|
|
|
@ -1881,11 +1881,13 @@ void BlackboxWindow::setGravityOffsets(void) {
|
||||||
// x coordinates for each gravity type
|
// x coordinates for each gravity type
|
||||||
const int x_west = client.rect.x();
|
const int x_west = client.rect.x();
|
||||||
const int x_east = client.rect.right() - frame.inside_w + 1;
|
const int x_east = client.rect.right() - frame.inside_w + 1;
|
||||||
const int x_center = client.rect.right() - (frame.rect.width()/2) + 1;
|
const int x_center = client.rect.left() +
|
||||||
|
((client.rect.width() - frame.rect.width()) / 2);
|
||||||
// y coordinates for each gravity type
|
// y coordinates for each gravity type
|
||||||
const int y_north = client.rect.y();
|
const int y_north = client.rect.y();
|
||||||
const int y_south = client.rect.bottom() - frame.inside_h + 1;
|
const int y_south = client.rect.bottom() - frame.inside_h + 1;
|
||||||
const int y_center = client.rect.bottom() - (frame.rect.height()/2) + 1;
|
const int y_center = client.rect.top() +
|
||||||
|
((client.rect.height() - frame.rect.height()) / 2);
|
||||||
|
|
||||||
switch (client.win_gravity) {
|
switch (client.win_gravity) {
|
||||||
default:
|
default:
|
||||||
|
@ -1916,13 +1918,13 @@ void BlackboxWindow::restoreGravity(void) {
|
||||||
// x coordinates for each gravity type
|
// x coordinates for each gravity type
|
||||||
const int x_west = frame.rect.x();
|
const int x_west = frame.rect.x();
|
||||||
const int x_east = frame.rect.x() + frame.inside_w - client.rect.width();
|
const int x_east = frame.rect.x() + frame.inside_w - client.rect.width();
|
||||||
const int x_center = frame.rect.x() + (frame.rect.width()/2) -
|
const int x_center = frame.rect.x() -
|
||||||
client.rect.width();
|
((client.rect.width() - frame.rect.width()) / 2);
|
||||||
// y coordinates for each gravity type
|
// y coordinates for each gravity type
|
||||||
const int y_north = frame.rect.y();
|
const int y_north = frame.rect.y();
|
||||||
const int y_south = frame.rect.y() + frame.inside_h - client.rect.height();
|
const int y_south = frame.rect.y() + frame.inside_h - client.rect.height();
|
||||||
const int y_center = frame.rect.y() + (frame.rect.height()/2) -
|
const int y_center = frame.rect.y() -
|
||||||
client.rect.height();
|
((client.rect.height() - frame.rect.height()) / 2);
|
||||||
|
|
||||||
switch(client.win_gravity) {
|
switch(client.win_gravity) {
|
||||||
default:
|
default:
|
||||||
|
@ -2381,7 +2383,7 @@ void BlackboxWindow::buttonPressEvent(XButtonEvent *be) {
|
||||||
// snap the window menu into a corner if necessary - we check the
|
// snap the window menu into a corner if necessary - we check the
|
||||||
// position of the menu with the coordinates of the client to
|
// position of the menu with the coordinates of the client to
|
||||||
// make the comparisions easier.
|
// make the comparisions easier.
|
||||||
// ### this needs some work!
|
// XXX: this needs some work!
|
||||||
if (mx > client.rect.right() -
|
if (mx > client.rect.right() -
|
||||||
static_cast<signed>(windowmenu->getWidth()))
|
static_cast<signed>(windowmenu->getWidth()))
|
||||||
mx = frame.rect.right() - windowmenu->getWidth() - frame.border_w + 1;
|
mx = frame.rect.right() - windowmenu->getWidth() - frame.border_w + 1;
|
||||||
|
|
|
@ -192,9 +192,9 @@ void Windowmenu::SendtoWorkspacemenu::update(void) {
|
||||||
++r;
|
++r;
|
||||||
} else {
|
} else {
|
||||||
changeItemLabel(i, getScreen()->getWorkspace(i)->getName());
|
changeItemLabel(i, getScreen()->getWorkspace(i)->getName());
|
||||||
}
|
|
||||||
setItemEnabled(i, i != getScreen()->getCurrentWorkspaceID());
|
setItemEnabled(i, i != getScreen()->getCurrentWorkspaceID());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Basemenu::update();
|
Basemenu::update();
|
||||||
}
|
}
|
||||||
|
|
|
@ -488,11 +488,14 @@ bool Workspace::smartPlacement(Rect& win, const Rect& availableArea) {
|
||||||
spaces.push_back(availableArea); //initially the entire screen is free
|
spaces.push_back(availableArea); //initially the entire screen is free
|
||||||
|
|
||||||
//Find Free Spaces
|
//Find Free Spaces
|
||||||
BlackboxWindowList::iterator wit = windowList.begin(),
|
BlackboxWindowList::const_iterator wit = windowList.begin(),
|
||||||
end = windowList.end();
|
end = windowList.end();
|
||||||
Rect tmp;
|
Rect tmp;
|
||||||
for (; wit != end; ++wit) {
|
for (; wit != end; ++wit) {
|
||||||
const BlackboxWindow* const curr = *wit;
|
const BlackboxWindow* const curr = *wit;
|
||||||
|
|
||||||
|
if (curr->isShaded()) continue;
|
||||||
|
|
||||||
tmp.setRect(curr->frameRect().x(), curr->frameRect().y(),
|
tmp.setRect(curr->frameRect().x(), curr->frameRect().y(),
|
||||||
curr->frameRect().width() + screen->getBorderWidth(),
|
curr->frameRect().width() + screen->getBorderWidth(),
|
||||||
curr->frameRect().height() + screen->getBorderWidth());
|
curr->frameRect().height() + screen->getBorderWidth());
|
||||||
|
|
Loading…
Reference in a new issue