adjust to the new format for otk::Proeprty::get() functions (no nelements)
let the user specify if it is a 'final' move for a window or not, and the client will only be sent a ConfigureNotify if it is.
This commit is contained in:
parent
232092fa21
commit
ccb58d37ee
2 changed files with 38 additions and 30 deletions
|
@ -167,7 +167,7 @@ void Client::getType()
|
||||||
_type = (WindowType) -1;
|
_type = (WindowType) -1;
|
||||||
|
|
||||||
unsigned long *val;
|
unsigned long *val;
|
||||||
unsigned long num = (unsigned) -1;
|
unsigned long num;
|
||||||
if (otk::Property::get(_window, otk::Property::atoms.net_wm_window_type,
|
if (otk::Property::get(_window, otk::Property::atoms.net_wm_window_type,
|
||||||
otk::Property::atoms.atom, &num, &val)) {
|
otk::Property::atoms.atom, &num, &val)) {
|
||||||
// use the first value that we know about in the array
|
// use the first value that we know about in the array
|
||||||
|
@ -372,7 +372,7 @@ void Client::getState()
|
||||||
_iconic = _skip_taskbar = _skip_pager = false;
|
_iconic = _skip_taskbar = _skip_pager = false;
|
||||||
|
|
||||||
unsigned long *state;
|
unsigned long *state;
|
||||||
unsigned long num = (unsigned) -1;
|
unsigned long num;
|
||||||
|
|
||||||
if (otk::Property::get(_window, otk::Property::atoms.net_wm_state,
|
if (otk::Property::get(_window, otk::Property::atoms.net_wm_state,
|
||||||
otk::Property::atoms.atom, &num, &state)) {
|
otk::Property::atoms.atom, &num, &state)) {
|
||||||
|
@ -717,7 +717,7 @@ void Client::updateTransientFor()
|
||||||
|
|
||||||
void Client::updateIcons()
|
void Client::updateIcons()
|
||||||
{
|
{
|
||||||
unsigned long num = (unsigned) -1;
|
unsigned long num;
|
||||||
unsigned long *data;
|
unsigned long *data;
|
||||||
unsigned long w, h, i = 0;
|
unsigned long w, h, i = 0;
|
||||||
|
|
||||||
|
@ -775,7 +775,7 @@ void Client::updateKwmIcon()
|
||||||
Pixmap *data;
|
Pixmap *data;
|
||||||
if (otk::Property::get(_window, otk::Property::atoms.kwm_win_icon,
|
if (otk::Property::get(_window, otk::Property::atoms.kwm_win_icon,
|
||||||
otk::Property::atoms.kwm_win_icon, &num, &data)) {
|
otk::Property::atoms.kwm_win_icon, &num, &data)) {
|
||||||
if (num >= 2) {
|
if (num == 2) {
|
||||||
_pixmap_icon = data[0];
|
_pixmap_icon = data[0];
|
||||||
_pixmap_icon_mask = data[1];
|
_pixmap_icon_mask = data[1];
|
||||||
}
|
}
|
||||||
|
@ -1283,15 +1283,15 @@ const Icon *Client::icon(const otk::Size &s) const
|
||||||
return &_icons[li];
|
return &_icons[li];
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::move(int x, int y)
|
void Client::move(int x, int y, bool final)
|
||||||
{
|
{
|
||||||
if (!(_functions & Func_Move)) return;
|
if (!(_functions & Func_Move)) return;
|
||||||
frame->frameGravity(x, y); // get the client's position based on x,y for the
|
frame->frameGravity(x, y); // get the client's position based on x,y for the
|
||||||
// frame
|
// frame
|
||||||
internal_move(x, y);
|
internal_move(x, y, final);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::internal_move(int x, int y)
|
void Client::internal_move(int x, int y, bool final)
|
||||||
{
|
{
|
||||||
_area = otk::Rect(otk::Point(x, y), _area.size());
|
_area = otk::Rect(otk::Point(x, y), _area.size());
|
||||||
|
|
||||||
|
@ -1301,6 +1301,7 @@ void Client::internal_move(int x, int y)
|
||||||
|
|
||||||
// send synthetic configure notify (we don't need to if we aren't mapped
|
// send synthetic configure notify (we don't need to if we aren't mapped
|
||||||
// yet)
|
// yet)
|
||||||
|
if (final) {
|
||||||
XEvent event;
|
XEvent event;
|
||||||
event.type = ConfigureNotify;
|
event.type = ConfigureNotify;
|
||||||
event.xconfigure.display = **otk::display;
|
event.xconfigure.display = **otk::display;
|
||||||
|
@ -1325,6 +1326,7 @@ void Client::internal_move(int x, int y)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Client::close()
|
void Client::close()
|
||||||
{
|
{
|
||||||
|
@ -1541,7 +1543,7 @@ void Client::maximize(bool max, int dir, bool savearea)
|
||||||
if (otk::Property::get(_window, otk::Property::atoms.openbox_premax,
|
if (otk::Property::get(_window, otk::Property::atoms.openbox_premax,
|
||||||
otk::Property::atoms.cardinal, &n,
|
otk::Property::atoms.cardinal, &n,
|
||||||
(long unsigned**) &readdim)) {
|
(long unsigned**) &readdim)) {
|
||||||
if (n >= 4) {
|
if (n == 4) {
|
||||||
if (_max_horz) {
|
if (_max_horz) {
|
||||||
dimensions[0] = readdim[0];
|
dimensions[0] = readdim[0];
|
||||||
dimensions[2] = readdim[2];
|
dimensions[2] = readdim[2];
|
||||||
|
@ -1573,7 +1575,7 @@ void Client::maximize(bool max, int dir, bool savearea)
|
||||||
if (otk::Property::get(_window, otk::Property::atoms.openbox_premax,
|
if (otk::Property::get(_window, otk::Property::atoms.openbox_premax,
|
||||||
otk::Property::atoms.cardinal, &n,
|
otk::Property::atoms.cardinal, &n,
|
||||||
(long unsigned**) &dimensions)) {
|
(long unsigned**) &dimensions)) {
|
||||||
if (n >= 4) {
|
if (n == 4) {
|
||||||
if (dir == 0 || dir == 1) { // horz
|
if (dir == 0 || dir == 1) { // horz
|
||||||
x = (signed int)dimensions[0];
|
x = (signed int)dimensions[0];
|
||||||
w = (signed int)dimensions[2];
|
w = (signed int)dimensions[2];
|
||||||
|
@ -1656,7 +1658,7 @@ void Client::fullscreen(bool fs, bool savearea)
|
||||||
if (otk::Property::get(_window, otk::Property::atoms.openbox_premax,
|
if (otk::Property::get(_window, otk::Property::atoms.openbox_premax,
|
||||||
otk::Property::atoms.cardinal, &n,
|
otk::Property::atoms.cardinal, &n,
|
||||||
(long unsigned**) &dimensions)) {
|
(long unsigned**) &dimensions)) {
|
||||||
if (n >= 4) {
|
if (n == 4) {
|
||||||
x = dimensions[0];
|
x = dimensions[0];
|
||||||
y = dimensions[1];
|
y = dimensions[1];
|
||||||
w = dimensions[2];
|
w = dimensions[2];
|
||||||
|
|
|
@ -478,8 +478,11 @@ private:
|
||||||
/*!
|
/*!
|
||||||
@param x The X coordinate to move to.
|
@param x The X coordinate to move to.
|
||||||
@param y The Y coordinate to move to.
|
@param y The Y coordinate to move to.
|
||||||
|
@param final true if this is the final move, false if there are more move
|
||||||
|
events coming. The client is not notified of the move when
|
||||||
|
final is false.
|
||||||
*/
|
*/
|
||||||
void internal_move(int x, int y);
|
void internal_move(int x, int y, bool final = true);
|
||||||
//! Internal version of the Client::resize function
|
//! Internal version of the Client::resize function
|
||||||
/*!
|
/*!
|
||||||
This also maintains things like the client's minsize, and size increments.
|
This also maintains things like the client's minsize, and size increments.
|
||||||
|
@ -674,8 +677,11 @@ public:
|
||||||
the position specified.
|
the position specified.
|
||||||
@param x The X coordinate to move to.
|
@param x The X coordinate to move to.
|
||||||
@param y The Y coordinate to move to.
|
@param y The Y coordinate to move to.
|
||||||
|
@param final true if this is the final move, false if there are more move
|
||||||
|
events coming. The client is not notified of the move when
|
||||||
|
final is false.
|
||||||
*/
|
*/
|
||||||
void move(int x, int y);
|
void move(int x, int y, bool final = true);
|
||||||
|
|
||||||
//! Resizes the client window, anchoring it in a given corner
|
//! Resizes the client window, anchoring it in a given corner
|
||||||
/*!
|
/*!
|
||||||
|
|
Loading…
Reference in a new issue