#include "actions.hh"
#include "widget.hh"
#include "openbox.hh"
+#include "client.hh"
#include "otk/display.hh"
#include <stdio.h>
// XXX: i can envision all sorts of crazy shit with this.. gestures, etc
printf("GUILE: MOTION: win %lx type %d modifiers %u x %d y %d\n",
(long)e.window, (w ? w->type():-1), e.state, _dx, _dy);
+
+ if (w && (w->type() == OBWidget::Type_Titlebar ||
+ w->type() == OBWidget::Type_Label)) {
+ OBClient *c = Openbox::instance->findClient(e.window);
+ if (c) c->move(c->area().x() + _dx, c->area().y() + _dy);
+ }
}
void updateClass();
// XXX: updateTransientFor();
- //! Move the client window
- void move(int x, int y);
-
- //! Resizes the client window, anchoring it in a given corner
- /*!
- This also maintains things like the client's minsize, and size increments.
- @param anchor The corner to keep in the same position when resizing
- @param x The X component of the new size for the client
- @param y The Y component of the new size for the client
- */
- void resize(Corner anchor, int x, int y);
-
public:
//! Constructs a new OBClient object around a specified window id
/*!
//! Returns the position and size of the client relative to the root window
inline const otk::Rect &area() const { return _area; }
+ //! Move the client window
+ void move(int x, int y);
+
+ //! Resizes the client window, anchoring it in a given corner
+ /*!
+ This also maintains things like the client's minsize, and size increments.
+ @param anchor The corner to keep in the same position when resizing
+ @param x The X component of the new size for the client
+ @param y The Y component of the new size for the client
+ */
+ void resize(Corner anchor, int x, int y);
+
virtual void propertyHandler(const XPropertyEvent &e);
virtual void clientMessageHandler(const XClientMessageEvent &e);
virtual void shapeHandler(const XShapeEvent &e);
*/
void frameGravity(int &x, int &y);
+ //! Gets the window id of the frame's "plate" subelement
+ inline Window plate() const { return _plate.getWindow(); }
+ //! Gets the window id of the frame's "titlebar" subelement
+ inline Window titlebar() const { return _titlebar.getWindow(); }
+ //! Gets the window id of the frame's "label" subelement
+ inline Window label() const { return _label.getWindow(); }
+ //! Gets the window id of the frame's "close button" subelement
+ inline Window button_close() const { return _button_close.getWindow(); }
+ //! Gets the window id of the frame's "iconify button" subelement
+ inline Window button_iconify() const { return _button_iconify.getWindow(); }
+ //! Gets the window id of the frame's "maximize button" subelement
+ inline Window button_max() const { return _button_max.getWindow(); }
+ //! Gets the window id of the frame's "sticky button" subelement
+ inline Window button_stick() const { return _button_stick.getWindow(); }
+ //! Gets the window id of the frame's "handle" subelement
+ inline Window handle() const { return _handle.getWindow(); }
+ //! Gets the window id of the frame's "left grip" subelement
+ inline Window grip_left() const { return _grip_left.getWindow(); }
+ //! Gets the window id of the frame's "right grip" subelement
+ inline Window grip_right() const { return _grip_right.getWindow(); }
+
};
}
CWEventMask|CWDontPropagate, &attrib_set);
// create the OBClient class, which gets all of the hints on the window
- Openbox::instance->addClient(window, client = new OBClient(_number, window));
+ client = new OBClient(_number, window);
// register for events
Openbox::instance->registerHandler(window, client);
+ // add to the wm's map
+ Openbox::instance->addClient(window, client);
// we dont want a border on the client
client->toggleClientBorder(false);
// create the decoration frame for the client window
client->frame = new OBFrame(client, &_style);
+ // add to the wm's map
+ Openbox::instance->addClient(client->frame->getWindow(), client);
+ Openbox::instance->addClient(client->frame->plate(), client);
+ Openbox::instance->addClient(client->frame->titlebar(), client);
+ Openbox::instance->addClient(client->frame->label(), client);
+ Openbox::instance->addClient(client->frame->button_max(), client);
+ Openbox::instance->addClient(client->frame->button_iconify(), client);
+ Openbox::instance->addClient(client->frame->button_stick(), client);
+ Openbox::instance->addClient(client->frame->button_close(), client);
+ Openbox::instance->addClient(client->frame->handle(), client);
+ Openbox::instance->addClient(client->frame->grip_left(), client);
+ Openbox::instance->addClient(client->frame->grip_right(), client);
+
// XXX: if on the current desktop..
client->frame->show();
// remove from the wm's map
Openbox::instance->removeClient(client->window());
+ Openbox::instance->removeClient(frame->getWindow());
+ Openbox::instance->removeClient(frame->plate());
+ Openbox::instance->removeClient(frame->titlebar());
+ Openbox::instance->removeClient(frame->label());
+ Openbox::instance->removeClient(frame->button_max());
+ Openbox::instance->removeClient(frame->button_iconify());
+ Openbox::instance->removeClient(frame->button_stick());
+ Openbox::instance->removeClient(frame->button_close());
+ Openbox::instance->removeClient(frame->handle());
+ Openbox::instance->removeClient(frame->grip_left());
+ Openbox::instance->removeClient(frame->grip_right());
// unregister for handling events
Openbox::instance->clearHandler(client->window());