_WIN_WORKSPACE atom and some indent

This commit is contained in:
fluxgen 2002-02-04 06:53:14 +00:00
parent ae9d3d84c9
commit 7b175210c8

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: Window.cc,v 1.23 2002/01/27 13:13:33 fluxgen Exp $
// $Id: Window.cc,v 1.24 2002/02/04 06:53:14 fluxgen Exp $
// stupid macros needed to access some functions in version 2 of the GNU C
// library
@ -162,7 +162,6 @@ tab(0)
XWindowAttributes wattrib;
if ((! XGetWindowAttributes(display, client.window, &wattrib)) ||
(! wattrib.screen) || wattrib.override_redirect) {
//fluxbox->ungrab();
throw FluxboxWindow::XGETWINDOWATTRIB;
}
@ -392,27 +391,28 @@ tab(0)
}
setFocusFlag(false);
/*
#ifdef DEBUG
fprintf(stderr, "%s(%d): FluxboxWindow(this=%p)\n", __FILE__, __LINE__, this);
#endif
*/
//TODO move this
#ifdef GNOME
int val = workspace_number;
XChangeProperty(display, client.window, screen->getBaseDisplay()->getGnomeWorkspaceAtom(), XA_CARDINAL, 32,
PropModeReplace, (unsigned char *)&val, 1);
XChangeProperty(display, client.window, screen->getBaseDisplay()->getGnomeWorkspaceAtom(),
XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1);
#endif
}
FluxboxWindow::~FluxboxWindow(void) {
#ifdef GNOME
XDeleteProperty (display, client.window, screen->getBaseDisplay()->getGnomeWorkspaceAtom());
#endif
Fluxbox *fluxbox = Fluxbox::instance();
//TODO: Move this to Workspace::removeWindow
if (client.transient_for)
fluxbox->setFocusedWindow(client.transient_for);
if (moving || resizing) {
screen->hideGeometry();
@ -448,6 +448,9 @@ FluxboxWindow::~FluxboxWindow(void) {
if (client.blackbox_hint)
XFree(client.blackbox_hint);
//TODO: Move this to Workspace::removeWindow
if (client.transient_for)
fluxbox->setFocusedWindow(client.transient_for);
if (client.window_group)
fluxbox->removeGroupSearch(client.window_group);
@ -593,8 +596,7 @@ Window FluxboxWindow::createToplevelWindow(int x, int y, unsigned int width,
Window FluxboxWindow::createChildWindow(Window parent, Cursor cursor) {
XSetWindowAttributes attrib_create;
unsigned long create_mask = CWBackPixmap | CWBorderPixel |
CWEventMask;
unsigned long create_mask = CWBackPixmap | CWBorderPixel | CWEventMask;
attrib_create.background_pixmap = None;
attrib_create.event_mask = ButtonPressMask | ButtonReleaseMask |
@ -626,10 +628,10 @@ void FluxboxWindow::associateClientWindow(void) {
XFlush(display);
attrib_set.event_mask = PropertyChangeMask | StructureNotifyMask |
FocusChangeMask;
attrib_set.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask |
ButtonMotionMask;
attrib_set.event_mask =
PropertyChangeMask | StructureNotifyMask | FocusChangeMask;
attrib_set.do_not_propagate_mask =
ButtonPressMask | ButtonReleaseMask | ButtonMotionMask;
XChangeWindowAttributes(display, client.window, CWEventMask|CWDontPropagate,
&attrib_set);
@ -671,10 +673,11 @@ void FluxboxWindow::associateClientWindow(void) {
#endif // SHAPE
//create the buttons
if (decorations.iconify)
createButton(Fluxbox::MINIMIZE, FluxboxWindow::iconifyPressed_cb, FluxboxWindow::iconifyButton_cb, FluxboxWindow::iconifyDraw_cb);
createButton(Fluxbox::MINIMIZE, FluxboxWindow::iconifyPressed_cb,
FluxboxWindow::iconifyButton_cb, FluxboxWindow::iconifyDraw_cb);
if (decorations.maximize)
createButton(Fluxbox::MAXIMIZE, FluxboxWindow::maximizePressed_cb, FluxboxWindow::maximizeButton_cb,
FluxboxWindow::maximizeDraw_cb);
createButton(Fluxbox::MAXIMIZE, FluxboxWindow::maximizePressed_cb,
FluxboxWindow::maximizeButton_cb, FluxboxWindow::maximizeDraw_cb);
if (decorations.close)
createButton(Fluxbox::CLOSE, FluxboxWindow::closePressed_cb,
FluxboxWindow::closeButton_cb, FluxboxWindow::closeDraw_cb);
@ -860,10 +863,10 @@ void FluxboxWindow::createButton(int type, ButtonEventProc pressed, ButtonEventP
}
Window FluxboxWindow::findTitleButton(int type) {
for (unsigned int i=0; i<buttonlist.size(); i++)
for (unsigned int i=0; i<buttonlist.size(); i++) {
if (buttonlist[i].type == type)
return buttonlist[i].win;
}
return 0;
}
void FluxboxWindow::stickyButton_cb(FluxboxWindow *t, XButtonEvent *be) {
@ -933,7 +936,6 @@ void FluxboxWindow::iconifyDraw_cb(FluxboxWindow *t, Window w, bool pressed) {
((t->focused) ? t->screen->getWindowStyle()->b_pic_focus_gc :
t->screen->getWindowStyle()->b_pic_unfocus_gc),
2, t->frame.button_h - 5, t->frame.button_w - 5, 2);
}
void FluxboxWindow::maximizeDraw_cb(FluxboxWindow *t, Window w, bool pressed) {
@ -1537,6 +1539,10 @@ void FluxboxWindow::getBlackboxHints(void) {
void FluxboxWindow::configure(int dx, int dy,
unsigned int dw, unsigned int dh) {
//we don't want negative size
if (dw <0 || dh<0)
return;
bool send_event = (frame.x != dx || frame.y != dy);
if ((dw != frame.width) || (dh != frame.height)) {
@ -2079,7 +2085,8 @@ void FluxboxWindow::stick(void) {
blackbox_attrib.attrib |= BaseDisplay::ATTRIB_OMNIPRESENT;
}
//find a STICK button in window
redrawAllButtons();
setState(current_state);
}
@ -3099,7 +3106,7 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent *me) {
resizing = true;
fluxbox->grab();
// fluxbox->grab();
int gx, gy;
frame.grab_x = me->x - screen->getBorderWidth();