finish conversion to the new otk::OBProperty class with its new interface
This commit is contained in:
parent
68016ac352
commit
c9f36d34a4
12 changed files with 221 additions and 191 deletions
|
@ -141,15 +141,19 @@ public:
|
|||
kde_net_wm_system_tray_window_for,
|
||||
kde_net_wm_window_type_override,
|
||||
|
||||
#ifndef DOXYGEN_IGNORE
|
||||
// constant for how many atoms exist in the enumerator
|
||||
NUM_ATOMS
|
||||
#endif
|
||||
};
|
||||
|
||||
//! The possible types/encodings of strings
|
||||
enum StringType {
|
||||
ascii, //!< Standard 8-bit ascii string
|
||||
utf8, //!< Utf8-encoded string
|
||||
#ifndef DOXYGEN_IGNORE
|
||||
NUM_STRING_TYPE
|
||||
#endif
|
||||
};
|
||||
|
||||
private:
|
||||
|
|
|
@ -16,7 +16,7 @@ bin_PROGRAMS= openbox
|
|||
openbox_LDADD=../otk/libotk.a @LIBINTL@
|
||||
|
||||
openbox_SOURCES= configuration.cc screen.cc openbox.cc \
|
||||
util.cc bbwindow.cc workspace.cc atom.cc blackbox.cc \
|
||||
util.cc bbwindow.cc workspace.cc blackbox.cc \
|
||||
main.cc xeventhandler.cc
|
||||
|
||||
MAINTAINERCLEANFILES= Makefile.in
|
||||
|
|
188
src/bbwindow.cc
188
src/bbwindow.cc
|
@ -1049,8 +1049,9 @@ void BlackboxWindow::positionWindows(void) {
|
|||
void BlackboxWindow::updateStrut(void) {
|
||||
unsigned long num = 4;
|
||||
unsigned long *data;
|
||||
if (! xatom->getValue(client.window, OBAtom::net_wm_strut, OBAtom::cardinal,
|
||||
num, &data))
|
||||
if (! xatom->get(client.window, otk::OBProperty::net_wm_strut,
|
||||
otk::OBProperty::Atom_Cardinal,
|
||||
&num, &data))
|
||||
return;
|
||||
|
||||
if (num == 4) {
|
||||
|
@ -1071,27 +1072,28 @@ bool BlackboxWindow::getWindowType(void) {
|
|||
|
||||
unsigned long *val;
|
||||
unsigned long num = (unsigned) -1;
|
||||
if (xatom->getValue(client.window, OBAtom::net_wm_window_type, OBAtom::atom,
|
||||
num, &val)) {
|
||||
if (xatom->get(client.window, otk::OBProperty::net_wm_window_type,
|
||||
otk::OBProperty::Atom_Atom,
|
||||
&num, &val)) {
|
||||
for (unsigned long i = 0; i < num; ++i) {
|
||||
if (val[i] == xatom->getAtom(OBAtom::net_wm_window_type_desktop))
|
||||
if (val[i] == xatom->atom(otk::OBProperty::net_wm_window_type_desktop))
|
||||
window_type = Type_Desktop;
|
||||
else if (val[i] == xatom->getAtom(OBAtom::net_wm_window_type_dock))
|
||||
else if (val[i] == xatom->atom(otk::OBProperty::net_wm_window_type_dock))
|
||||
window_type = Type_Dock;
|
||||
else if (val[i] == xatom->getAtom(OBAtom::net_wm_window_type_toolbar))
|
||||
else if (val[i] == xatom->atom(otk::OBProperty::net_wm_window_type_toolbar))
|
||||
window_type = Type_Toolbar;
|
||||
else if (val[i] == xatom->getAtom(OBAtom::net_wm_window_type_menu))
|
||||
else if (val[i] == xatom->atom(otk::OBProperty::net_wm_window_type_menu))
|
||||
window_type = Type_Menu;
|
||||
else if (val[i] == xatom->getAtom(OBAtom::net_wm_window_type_utility))
|
||||
else if (val[i] == xatom->atom(otk::OBProperty::net_wm_window_type_utility))
|
||||
window_type = Type_Utility;
|
||||
else if (val[i] == xatom->getAtom(OBAtom::net_wm_window_type_splash))
|
||||
else if (val[i] == xatom->atom(otk::OBProperty::net_wm_window_type_splash))
|
||||
window_type = Type_Splash;
|
||||
else if (val[i] == xatom->getAtom(OBAtom::net_wm_window_type_dialog))
|
||||
else if (val[i] == xatom->atom(otk::OBProperty::net_wm_window_type_dialog))
|
||||
window_type = Type_Dialog;
|
||||
else if (val[i] == xatom->getAtom(OBAtom::net_wm_window_type_normal))
|
||||
else if (val[i] == xatom->atom(otk::OBProperty::net_wm_window_type_normal))
|
||||
window_type = Type_Normal;
|
||||
else if (val[i] ==
|
||||
xatom->getAtom(OBAtom::kde_net_wm_window_type_override))
|
||||
xatom->atom(otk::OBProperty::kde_net_wm_window_type_override))
|
||||
mwm_decorations = 0; // prevent this window from getting any decor
|
||||
}
|
||||
delete val;
|
||||
|
@ -1115,22 +1117,23 @@ bool BlackboxWindow::getWindowType(void) {
|
|||
|
||||
|
||||
void BlackboxWindow::getWMName(void) {
|
||||
if (xatom->getValue(client.window, OBAtom::net_wm_name,
|
||||
OBAtom::utf8, client.title) &&
|
||||
if (xatom->get(client.window, otk::OBProperty::net_wm_name,
|
||||
otk::OBProperty::utf8, &client.title) &&
|
||||
!client.title.empty()) {
|
||||
xatom->eraseValue(client.window, OBAtom::net_wm_visible_name);
|
||||
xatom->erase(client.window, otk::OBProperty::net_wm_visible_name);
|
||||
return;
|
||||
}
|
||||
//fall through to using WM_NAME
|
||||
if (xatom->getValue(client.window, OBAtom::wm_name, OBAtom::ansi, client.title)
|
||||
if (xatom->get(client.window, otk::OBProperty::wm_name,
|
||||
otk::OBProperty::ascii, &client.title)
|
||||
&& !client.title.empty()) {
|
||||
xatom->eraseValue(client.window, OBAtom::net_wm_visible_name);
|
||||
xatom->erase(client.window, otk::OBProperty::net_wm_visible_name);
|
||||
return;
|
||||
}
|
||||
// fall back to an internal default
|
||||
client.title = "Unnamed";
|
||||
xatom->setValue(client.window, OBAtom::net_wm_visible_name, OBAtom::utf8,
|
||||
client.title);
|
||||
xatom->set(client.window, otk::OBProperty::net_wm_visible_name,
|
||||
otk::OBProperty::utf8, client.title);
|
||||
|
||||
#ifdef DEBUG_WITH_ID
|
||||
// the 16 is the 8 chars of the debug text plus the number
|
||||
|
@ -1143,23 +1146,25 @@ void BlackboxWindow::getWMName(void) {
|
|||
|
||||
|
||||
void BlackboxWindow::getWMIconName(void) {
|
||||
if (xatom->getValue(client.window, OBAtom::net_wm_icon_name,
|
||||
OBAtom::utf8, client.icon_title) &&
|
||||
if (xatom->get(client.window, otk::OBProperty::net_wm_icon_name,
|
||||
otk::OBProperty::utf8, &client.icon_title) &&
|
||||
!client.icon_title.empty()) {
|
||||
xatom->eraseValue(client.window, OBAtom::net_wm_visible_icon_name);
|
||||
xatom->erase(client.window, otk::OBProperty::net_wm_visible_icon_name);
|
||||
return;
|
||||
}
|
||||
//fall through to using WM_ICON_NAME
|
||||
if (xatom->getValue(client.window, OBAtom::wm_icon_name, OBAtom::ansi,
|
||||
client.icon_title) &&
|
||||
if (xatom->get(client.window, otk::OBProperty::wm_icon_name,
|
||||
otk::OBProperty::ascii,
|
||||
&client.icon_title) &&
|
||||
!client.icon_title.empty()) {
|
||||
xatom->eraseValue(client.window, OBAtom::net_wm_visible_icon_name);
|
||||
xatom->erase(client.window, otk::OBProperty::net_wm_visible_icon_name);
|
||||
return;
|
||||
}
|
||||
// fall back to using the main name
|
||||
client.icon_title = client.title;
|
||||
xatom->setValue(client.window, OBAtom::net_wm_visible_icon_name, OBAtom::utf8,
|
||||
client.icon_title);
|
||||
xatom->set(client.window, otk::OBProperty::net_wm_visible_icon_name,
|
||||
otk::OBProperty::utf8,
|
||||
client.icon_title);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1177,10 +1182,10 @@ void BlackboxWindow::getWMProtocols(void) {
|
|||
if (XGetWMProtocols(otk::OBDisplay::display, client.window,
|
||||
&proto, &num_return)) {
|
||||
for (int i = 0; i < num_return; ++i) {
|
||||
if (proto[i] == xatom->getAtom(OBAtom::wm_delete_window)) {
|
||||
if (proto[i] == xatom->atom(otk::OBProperty::wm_delete_window)) {
|
||||
decorations |= Decor_Close;
|
||||
functions |= Func_Close;
|
||||
} else if (proto[i] == xatom->getAtom(OBAtom::wm_take_focus))
|
||||
} else if (proto[i] == xatom->atom(otk::OBProperty::wm_take_focus))
|
||||
flags.send_focus_message = True;
|
||||
}
|
||||
|
||||
|
@ -1318,8 +1323,9 @@ void BlackboxWindow::getWMNormalHints(void) {
|
|||
void BlackboxWindow::getNetWMHints(void) {
|
||||
unsigned long workspace;
|
||||
|
||||
if (xatom->getValue(client.window, OBAtom::net_wm_desktop, OBAtom::cardinal,
|
||||
workspace)) {
|
||||
if (xatom->get(client.window, otk::OBProperty::net_wm_desktop,
|
||||
otk::OBProperty::Atom_Cardinal,
|
||||
&workspace)) {
|
||||
if (workspace == 0xffffffff)
|
||||
flags.stuck = True;
|
||||
else
|
||||
|
@ -1328,26 +1334,27 @@ void BlackboxWindow::getNetWMHints(void) {
|
|||
|
||||
unsigned long *state;
|
||||
unsigned long num = (unsigned) -1;
|
||||
if (xatom->getValue(client.window, OBAtom::net_wm_state, OBAtom::atom,
|
||||
num, &state)) {
|
||||
if (xatom->get(client.window, otk::OBProperty::net_wm_state,
|
||||
otk::OBProperty::Atom_Atom,
|
||||
&num, &state)) {
|
||||
bool vert = False,
|
||||
horz = False;
|
||||
for (unsigned long i = 0; i < num; ++i) {
|
||||
if (state[i] == xatom->getAtom(OBAtom::net_wm_state_modal))
|
||||
if (state[i] == xatom->atom(otk::OBProperty::net_wm_state_modal))
|
||||
flags.modal = True;
|
||||
else if (state[i] == xatom->getAtom(OBAtom::net_wm_state_shaded))
|
||||
else if (state[i] == xatom->atom(otk::OBProperty::net_wm_state_shaded))
|
||||
flags.shaded = True;
|
||||
else if (state[i] == xatom->getAtom(OBAtom::net_wm_state_skip_taskbar))
|
||||
else if (state[i] == xatom->atom(otk::OBProperty::net_wm_state_skip_taskbar))
|
||||
flags.skip_taskbar = True;
|
||||
else if (state[i] == xatom->getAtom(OBAtom::net_wm_state_skip_pager))
|
||||
else if (state[i] == xatom->atom(otk::OBProperty::net_wm_state_skip_pager))
|
||||
flags.skip_pager = True;
|
||||
else if (state[i] == xatom->getAtom(OBAtom::net_wm_state_fullscreen))
|
||||
else if (state[i] == xatom->atom(otk::OBProperty::net_wm_state_fullscreen))
|
||||
flags.fullscreen = True;
|
||||
else if (state[i] == xatom->getAtom(OBAtom::net_wm_state_hidden))
|
||||
else if (state[i] == xatom->atom(otk::OBProperty::net_wm_state_hidden))
|
||||
setState(IconicState);
|
||||
else if (state[i] == xatom->getAtom(OBAtom::net_wm_state_maximized_vert))
|
||||
else if (state[i] == xatom->atom(otk::OBProperty::net_wm_state_maximized_vert))
|
||||
vert = True;
|
||||
else if (state[i] == xatom->getAtom(OBAtom::net_wm_state_maximized_horz))
|
||||
else if (state[i] == xatom->atom(otk::OBProperty::net_wm_state_maximized_horz))
|
||||
horz = True;
|
||||
}
|
||||
if (vert && horz)
|
||||
|
@ -1374,9 +1381,9 @@ void BlackboxWindow::getMWMHints(void) {
|
|||
MwmHints *mwm_hint;
|
||||
|
||||
num = PropMwmHintsElements;
|
||||
if (! xatom->getValue(client.window, OBAtom::motif_wm_hints,
|
||||
OBAtom::motif_wm_hints, num,
|
||||
(unsigned long **)&mwm_hint))
|
||||
if (! xatom->get(client.window, otk::OBProperty::motif_wm_hints,
|
||||
otk::OBProperty::motif_wm_hints, &num,
|
||||
(unsigned long **)&mwm_hint))
|
||||
return;
|
||||
if (num < PropMwmHintsElements) {
|
||||
delete [] mwm_hint;
|
||||
|
@ -1438,9 +1445,9 @@ bool BlackboxWindow::getBlackboxHints(void) {
|
|||
BlackboxHints *blackbox_hint;
|
||||
|
||||
num = PropBlackboxHintsElements;
|
||||
if (! xatom->getValue(client.window, OBAtom::blackbox_hints,
|
||||
OBAtom::blackbox_hints, num,
|
||||
(unsigned long **)&blackbox_hint))
|
||||
if (! xatom->get(client.window, otk::OBProperty::blackbox_hints,
|
||||
otk::OBProperty::blackbox_hints, &num,
|
||||
(unsigned long **)&blackbox_hint))
|
||||
return False;
|
||||
if (num < PropBlackboxHintsElements) {
|
||||
delete [] blackbox_hint;
|
||||
|
@ -1721,11 +1728,11 @@ bool BlackboxWindow::setInputFocus(void) {
|
|||
if (flags.send_focus_message) {
|
||||
XEvent ce;
|
||||
ce.xclient.type = ClientMessage;
|
||||
ce.xclient.message_type = xatom->getAtom(OBAtom::wm_protocols);
|
||||
ce.xclient.message_type = xatom->atom(otk::OBProperty::wm_protocols);
|
||||
ce.xclient.display = otk::OBDisplay::display;
|
||||
ce.xclient.window = client.window;
|
||||
ce.xclient.format = 32;
|
||||
ce.xclient.data.l[0] = xatom->getAtom(OBAtom::wm_take_focus);
|
||||
ce.xclient.data.l[0] = xatom->atom(otk::OBProperty::wm_take_focus);
|
||||
ce.xclient.data.l[1] = blackbox->getLastTime();
|
||||
ce.xclient.data.l[2] = 0l;
|
||||
ce.xclient.data.l[3] = 0l;
|
||||
|
@ -1846,11 +1853,11 @@ void BlackboxWindow::close(void) {
|
|||
|
||||
XEvent ce;
|
||||
ce.xclient.type = ClientMessage;
|
||||
ce.xclient.message_type = xatom->getAtom(OBAtom::wm_protocols);
|
||||
ce.xclient.message_type = xatom->atom(otk::OBProperty::wm_protocols);
|
||||
ce.xclient.display = otk::OBDisplay::display;
|
||||
ce.xclient.window = client.window;
|
||||
ce.xclient.format = 32;
|
||||
ce.xclient.data.l[0] = xatom->getAtom(OBAtom::wm_delete_window);
|
||||
ce.xclient.data.l[0] = xatom->atom(otk::OBProperty::wm_delete_window);
|
||||
ce.xclient.data.l[1] = CurrentTime;
|
||||
ce.xclient.data.l[2] = 0l;
|
||||
ce.xclient.data.l[3] = 0l;
|
||||
|
@ -2034,7 +2041,8 @@ void BlackboxWindow::setWorkspace(unsigned int n) {
|
|||
*/
|
||||
n = 0xffffffff;
|
||||
}
|
||||
xatom->setValue(client.window, OBAtom::net_wm_desktop, OBAtom::cardinal, n);
|
||||
xatom->set(client.window, otk::OBProperty::net_wm_desktop,
|
||||
otk::OBProperty::Atom_Cardinal, n);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2087,8 +2095,9 @@ void BlackboxWindow::stick(void) {
|
|||
screen->reassociateWindow(this, BSENTINEL, True);
|
||||
// temporary fix since sticky windows suck. set the hint to what we
|
||||
// actually hold in our data.
|
||||
xatom->setValue(client.window, OBAtom::net_wm_desktop, OBAtom::cardinal,
|
||||
blackbox_attrib.workspace);
|
||||
xatom->set(client.window, otk::OBProperty::net_wm_desktop,
|
||||
otk::OBProperty::Atom_Cardinal,
|
||||
blackbox_attrib.workspace);
|
||||
|
||||
setState(current_state);
|
||||
} else {
|
||||
|
@ -2099,8 +2108,9 @@ void BlackboxWindow::stick(void) {
|
|||
|
||||
// temporary fix since sticky windows suck. set the hint to a different
|
||||
// value than that contained in the class' data.
|
||||
xatom->setValue(client.window, OBAtom::net_wm_desktop, OBAtom::cardinal,
|
||||
0xffffffff);
|
||||
xatom->set(client.window, otk::OBProperty::net_wm_desktop,
|
||||
otk::OBProperty::Atom_Cardinal,
|
||||
0xffffffff);
|
||||
|
||||
for (unsigned int i = 0; i < screen->getNumberOfWorkspaces(); ++i)
|
||||
if (i != blackbox_attrib.workspace)
|
||||
|
@ -2254,21 +2264,22 @@ void BlackboxWindow::setAllowedActions(void) {
|
|||
Atom actions[7];
|
||||
int num = 0;
|
||||
|
||||
actions[num++] = xatom->getAtom(OBAtom::net_wm_action_shade);
|
||||
actions[num++] = xatom->getAtom(OBAtom::net_wm_action_change_desktop);
|
||||
actions[num++] = xatom->getAtom(OBAtom::net_wm_action_close);
|
||||
actions[num++] = xatom->atom(otk::OBProperty::net_wm_action_shade);
|
||||
actions[num++] = xatom->atom(otk::OBProperty::net_wm_action_change_desktop);
|
||||
actions[num++] = xatom->atom(otk::OBProperty::net_wm_action_close);
|
||||
|
||||
if (functions & Func_Move)
|
||||
actions[num++] = xatom->getAtom(OBAtom::net_wm_action_move);
|
||||
actions[num++] = xatom->atom(otk::OBProperty::net_wm_action_move);
|
||||
if (functions & Func_Resize)
|
||||
actions[num++] = xatom->getAtom(OBAtom::net_wm_action_resize);
|
||||
actions[num++] = xatom->atom(otk::OBProperty::net_wm_action_resize);
|
||||
if (functions & Func_Maximize) {
|
||||
actions[num++] = xatom->getAtom(OBAtom::net_wm_action_maximize_horz);
|
||||
actions[num++] = xatom->getAtom(OBAtom::net_wm_action_maximize_vert);
|
||||
actions[num++] = xatom->atom(otk::OBProperty::net_wm_action_maximize_horz);
|
||||
actions[num++] = xatom->atom(otk::OBProperty::net_wm_action_maximize_vert);
|
||||
}
|
||||
|
||||
xatom->setValue(client.window, OBAtom::net_wm_allowed_actions, OBAtom::atom,
|
||||
actions, num);
|
||||
xatom->set(client.window, otk::OBProperty::net_wm_allowed_actions,
|
||||
otk::OBProperty::Atom_Atom,
|
||||
actions, num);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2278,38 +2289,39 @@ void BlackboxWindow::setState(unsigned long new_state) {
|
|||
unsigned long state[2];
|
||||
state[0] = current_state;
|
||||
state[1] = None;
|
||||
xatom->setValue(client.window, OBAtom::wm_state, OBAtom::wm_state, state, 2);
|
||||
xatom->set(client.window, otk::OBProperty::wm_state, otk::OBProperty::wm_state, state, 2);
|
||||
|
||||
xatom->setValue(client.window, OBAtom::blackbox_attributes,
|
||||
OBAtom::blackbox_attributes, (unsigned long *)&blackbox_attrib,
|
||||
xatom->set(client.window, otk::OBProperty::blackbox_attributes,
|
||||
otk::OBProperty::blackbox_attributes, (unsigned long *)&blackbox_attrib,
|
||||
PropBlackboxAttributesElements);
|
||||
|
||||
Atom netstate[8];
|
||||
int num = 0;
|
||||
if (flags.modal)
|
||||
netstate[num++] = xatom->getAtom(OBAtom::net_wm_state_modal);
|
||||
netstate[num++] = xatom->atom(otk::OBProperty::net_wm_state_modal);
|
||||
if (flags.shaded)
|
||||
netstate[num++] = xatom->getAtom(OBAtom::net_wm_state_shaded);
|
||||
netstate[num++] = xatom->atom(otk::OBProperty::net_wm_state_shaded);
|
||||
if (flags.iconic)
|
||||
netstate[num++] = xatom->getAtom(OBAtom::net_wm_state_hidden);
|
||||
netstate[num++] = xatom->atom(otk::OBProperty::net_wm_state_hidden);
|
||||
if (flags.skip_taskbar)
|
||||
netstate[num++] = xatom->getAtom(OBAtom::net_wm_state_skip_taskbar);
|
||||
netstate[num++] = xatom->atom(otk::OBProperty::net_wm_state_skip_taskbar);
|
||||
if (flags.skip_pager)
|
||||
netstate[num++] = xatom->getAtom(OBAtom::net_wm_state_skip_pager);
|
||||
netstate[num++] = xatom->atom(otk::OBProperty::net_wm_state_skip_pager);
|
||||
if (flags.fullscreen)
|
||||
netstate[num++] = xatom->getAtom(OBAtom::net_wm_state_fullscreen);
|
||||
netstate[num++] = xatom->atom(otk::OBProperty::net_wm_state_fullscreen);
|
||||
if (flags.maximized == 1 || flags.maximized == 2)
|
||||
netstate[num++] = xatom->getAtom(OBAtom::net_wm_state_maximized_vert);
|
||||
netstate[num++] = xatom->atom(otk::OBProperty::net_wm_state_maximized_vert);
|
||||
if (flags.maximized == 1 || flags.maximized == 3)
|
||||
netstate[num++] = xatom->getAtom(OBAtom::net_wm_state_maximized_horz);
|
||||
xatom->setValue(client.window, OBAtom::net_wm_state, OBAtom::atom,
|
||||
netstate, num);
|
||||
netstate[num++] = xatom->atom(otk::OBProperty::net_wm_state_maximized_horz);
|
||||
xatom->set(client.window, otk::OBProperty::net_wm_state,
|
||||
otk::OBProperty::Atom_Atom,
|
||||
netstate, num);
|
||||
}
|
||||
|
||||
|
||||
bool BlackboxWindow::getState(void) {
|
||||
bool ret = xatom->getValue(client.window, OBAtom::wm_state, OBAtom::wm_state,
|
||||
current_state);
|
||||
bool ret = xatom->get(client.window, otk::OBProperty::wm_state,
|
||||
otk::OBProperty::wm_state, ¤t_state);
|
||||
if (! ret) current_state = 0;
|
||||
return ret;
|
||||
}
|
||||
|
@ -2318,8 +2330,8 @@ bool BlackboxWindow::getState(void) {
|
|||
void BlackboxWindow::restoreAttributes(void) {
|
||||
unsigned long num = PropBlackboxAttributesElements;
|
||||
BlackboxAttributes *net;
|
||||
if (! xatom->getValue(client.window, OBAtom::blackbox_attributes,
|
||||
OBAtom::blackbox_attributes, num,
|
||||
if (! xatom->get(client.window, otk::OBProperty::blackbox_attributes,
|
||||
otk::OBProperty::blackbox_attributes, &num,
|
||||
(unsigned long **)&net))
|
||||
return;
|
||||
if (num < PropBlackboxAttributesElements) {
|
||||
|
@ -2875,7 +2887,7 @@ void BlackboxWindow::propertyNotifyEvent(const XPropertyEvent *pe) {
|
|||
if (flags.iconic) screen->propagateWindowName(this);
|
||||
break;
|
||||
|
||||
case OBAtom::net_wm_name:
|
||||
case otk::OBProperty::net_wm_name:
|
||||
case XA_WM_NAME:
|
||||
getWMName();
|
||||
|
||||
|
@ -2917,7 +2929,7 @@ void BlackboxWindow::propertyNotifyEvent(const XPropertyEvent *pe) {
|
|||
}
|
||||
|
||||
default:
|
||||
if (pe->atom == xatom->getAtom(OBAtom::wm_protocols)) {
|
||||
if (pe->atom == xatom->atom(otk::OBProperty::wm_protocols)) {
|
||||
getWMProtocols();
|
||||
|
||||
if ((decorations & Decor_Close) && (! frame.close_button)) {
|
||||
|
@ -2927,7 +2939,7 @@ void BlackboxWindow::propertyNotifyEvent(const XPropertyEvent *pe) {
|
|||
XMapSubwindows(otk::OBDisplay::display, frame.title);
|
||||
}
|
||||
}
|
||||
} else if (pe->atom == xatom->getAtom(OBAtom::net_wm_strut)) {
|
||||
} else if (pe->atom == xatom->atom(otk::OBProperty::net_wm_strut)) {
|
||||
updateStrut();
|
||||
}
|
||||
|
||||
|
@ -3876,8 +3888,8 @@ void BlackboxWindow::restore(bool remap) {
|
|||
// erase the netwm stuff that we read when a window maps, so that it
|
||||
// doesn't persist between mappings.
|
||||
// (these are the ones read in getNetWMFlags().)
|
||||
xatom->eraseValue(client.window, OBAtom::net_wm_desktop);
|
||||
xatom->eraseValue(client.window, OBAtom::net_wm_state);
|
||||
xatom->erase(client.window, otk::OBProperty::net_wm_desktop);
|
||||
xatom->erase(client.window, otk::OBProperty::net_wm_state);
|
||||
|
||||
restoreGravity(client.rect);
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ extern "C" {
|
|||
#include <string>
|
||||
|
||||
#include "otk/timer.hh"
|
||||
#include "otk/property.hh"
|
||||
#include "blackbox.hh"
|
||||
#include "util.hh"
|
||||
|
||||
|
@ -104,7 +105,7 @@ public:
|
|||
private:
|
||||
Blackbox *blackbox;
|
||||
BScreen *screen;
|
||||
OBAtom *xatom;
|
||||
otk::OBProperty *xatom;
|
||||
otk::OBTimer *timer;
|
||||
BlackboxAttributes blackbox_attrib;
|
||||
|
||||
|
|
|
@ -83,7 +83,6 @@ using std::string;
|
|||
#include "util.hh"
|
||||
#include "bbwindow.hh"
|
||||
#include "workspace.hh"
|
||||
#include "atom.hh"
|
||||
|
||||
namespace ob {
|
||||
|
||||
|
@ -120,7 +119,7 @@ Blackbox::Blackbox(int argc, char **m_argv, char *rc)
|
|||
|
||||
load_rc();
|
||||
|
||||
xatom = new OBAtom();
|
||||
xatom = new otk::OBProperty();
|
||||
|
||||
cursor.session = XCreateFontCursor(otk::OBDisplay::display, XC_left_ptr);
|
||||
cursor.move = XCreateFontCursor(otk::OBDisplay::display, XC_fleur);
|
||||
|
@ -558,7 +557,7 @@ void Blackbox::process_event(XEvent *e) {
|
|||
|
||||
case ClientMessage: {
|
||||
if (e->xclient.format == 32) {
|
||||
if (e->xclient.message_type == xatom->getAtom(OBAtom::wm_change_state)) {
|
||||
if (e->xclient.message_type == xatom->atom(otk::OBProperty::wm_change_state)) {
|
||||
// WM_CHANGE_STATE message
|
||||
BlackboxWindow *win = searchWindow(e->xclient.window);
|
||||
if (! win || ! win->validateClient()) return;
|
||||
|
@ -568,9 +567,9 @@ void Blackbox::process_event(XEvent *e) {
|
|||
if (e->xclient.data.l[0] == NormalState)
|
||||
win->deiconify();
|
||||
} else if (e->xclient.message_type ==
|
||||
xatom->getAtom(OBAtom::blackbox_change_workspace) ||
|
||||
xatom->atom(otk::OBProperty::blackbox_change_workspace) ||
|
||||
e->xclient.message_type ==
|
||||
xatom->getAtom(OBAtom::net_current_desktop)) {
|
||||
xatom->atom(otk::OBProperty::net_current_desktop)) {
|
||||
// NET_CURRENT_DESKTOP message
|
||||
BScreen *screen = searchScreen(e->xclient.window);
|
||||
|
||||
|
@ -578,14 +577,14 @@ void Blackbox::process_event(XEvent *e) {
|
|||
if (screen && workspace < screen->getWorkspaceCount())
|
||||
screen->changeWorkspaceID(workspace);
|
||||
} else if (e->xclient.message_type ==
|
||||
xatom->getAtom(OBAtom::blackbox_change_window_focus)) {
|
||||
xatom->atom(otk::OBProperty::blackbox_change_window_focus)) {
|
||||
// TEMP HACK TO KEEP BBKEYS WORKING
|
||||
BlackboxWindow *win = searchWindow(e->xclient.window);
|
||||
|
||||
if (win && win->isVisible() && win->setInputFocus())
|
||||
win->installColormap(True);
|
||||
} else if (e->xclient.message_type ==
|
||||
xatom->getAtom(OBAtom::net_active_window)) {
|
||||
xatom->atom(otk::OBProperty::net_active_window)) {
|
||||
// NET_ACTIVE_WINDOW
|
||||
BlackboxWindow *win = searchWindow(e->xclient.window);
|
||||
|
||||
|
@ -606,7 +605,7 @@ void Blackbox::process_event(XEvent *e) {
|
|||
}
|
||||
}
|
||||
} else if (e->xclient.message_type ==
|
||||
xatom->getAtom(OBAtom::blackbox_cycle_window_focus)) {
|
||||
xatom->atom(otk::OBProperty::blackbox_cycle_window_focus)) {
|
||||
// BLACKBOX_CYCLE_WINDOW_FOCUS
|
||||
BScreen *screen = searchScreen(e->xclient.window);
|
||||
|
||||
|
@ -617,7 +616,7 @@ void Blackbox::process_event(XEvent *e) {
|
|||
screen->nextFocus();
|
||||
}
|
||||
} else if (e->xclient.message_type ==
|
||||
xatom->getAtom(OBAtom::net_wm_desktop)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_desktop)) {
|
||||
// NET_WM_DESKTOP
|
||||
BlackboxWindow *win = searchWindow(e->xclient.window);
|
||||
|
||||
|
@ -640,7 +639,7 @@ void Blackbox::process_event(XEvent *e) {
|
|||
}
|
||||
}
|
||||
} else if (e->xclient.message_type ==
|
||||
xatom->getAtom(OBAtom::blackbox_change_attributes)) {
|
||||
xatom->atom(otk::OBProperty::blackbox_change_attributes)) {
|
||||
// BLACKBOX_CHANGE_ATTRIBUTES
|
||||
BlackboxWindow *win = searchWindow(e->xclient.window);
|
||||
|
||||
|
@ -655,45 +654,45 @@ void Blackbox::process_event(XEvent *e) {
|
|||
win->changeBlackboxHints(&net);
|
||||
}
|
||||
} else if (e->xclient.message_type ==
|
||||
xatom->getAtom(OBAtom::net_number_of_desktops)) {
|
||||
xatom->atom(otk::OBProperty::net_number_of_desktops)) {
|
||||
// NET_NUMBER_OF_DESKTOPS
|
||||
BScreen *screen = searchScreen(e->xclient.window);
|
||||
|
||||
if (e->xclient.data.l[0] > 0)
|
||||
screen->changeWorkspaceCount((unsigned) e->xclient.data.l[0]);
|
||||
} else if (e->xclient.message_type ==
|
||||
xatom->getAtom(OBAtom::net_close_window)) {
|
||||
xatom->atom(otk::OBProperty::net_close_window)) {
|
||||
// NET_CLOSE_WINDOW
|
||||
BlackboxWindow *win = searchWindow(e->xclient.window);
|
||||
if (win && win->validateClient())
|
||||
win->close(); // could this be smarter?
|
||||
} else if (e->xclient.message_type ==
|
||||
xatom->getAtom(OBAtom::net_wm_moveresize)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_moveresize)) {
|
||||
// NET_WM_MOVERESIZE
|
||||
BlackboxWindow *win = searchWindow(e->xclient.window);
|
||||
if (win && win->validateClient()) {
|
||||
int x_root = e->xclient.data.l[0],
|
||||
y_root = e->xclient.data.l[1];
|
||||
if ((Atom) e->xclient.data.l[2] ==
|
||||
xatom->getAtom(OBAtom::net_wm_moveresize_move)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_moveresize_move)) {
|
||||
win->beginMove(x_root, y_root);
|
||||
} else {
|
||||
if ((Atom) e->xclient.data.l[2] ==
|
||||
xatom->getAtom(OBAtom::net_wm_moveresize_size_topleft))
|
||||
xatom->atom(otk::OBProperty::net_wm_moveresize_size_topleft))
|
||||
win->beginResize(x_root, y_root, BlackboxWindow::TopLeft);
|
||||
else if ((Atom) e->xclient.data.l[2] ==
|
||||
xatom->getAtom(OBAtom::net_wm_moveresize_size_topright))
|
||||
xatom->atom(otk::OBProperty::net_wm_moveresize_size_topright))
|
||||
win->beginResize(x_root, y_root, BlackboxWindow::TopRight);
|
||||
else if ((Atom) e->xclient.data.l[2] ==
|
||||
xatom->getAtom(OBAtom::net_wm_moveresize_size_bottomleft))
|
||||
xatom->atom(otk::OBProperty::net_wm_moveresize_size_bottomleft))
|
||||
win->beginResize(x_root, y_root, BlackboxWindow::BottomLeft);
|
||||
else if ((Atom) e->xclient.data.l[2] ==
|
||||
xatom->getAtom(OBAtom::net_wm_moveresize_size_bottomright))
|
||||
xatom->atom(otk::OBProperty::net_wm_moveresize_size_bottomright))
|
||||
win->beginResize(x_root, y_root, BlackboxWindow::BottomRight);
|
||||
}
|
||||
}
|
||||
} else if (e->xclient.message_type ==
|
||||
xatom->getAtom(OBAtom::net_wm_state)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state)) {
|
||||
// NET_WM_STATE
|
||||
BlackboxWindow *win = searchWindow(e->xclient.window);
|
||||
if (win && win->validateClient()) {
|
||||
|
@ -707,10 +706,10 @@ void Blackbox::process_event(XEvent *e) {
|
|||
|
||||
if ((Atom) e->xclient.data.l[0] == 1) {
|
||||
// ADD
|
||||
if (state[i] == xatom->getAtom(OBAtom::net_wm_state_modal)) {
|
||||
if (state[i] == xatom->atom(otk::OBProperty::net_wm_state_modal)) {
|
||||
win->setModal(True);
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_maximized_vert)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_maximized_vert)) {
|
||||
if (win->isMaximizedHoriz()) {
|
||||
win->maximize(0); // unmaximize
|
||||
win->maximize(1); // full
|
||||
|
@ -718,7 +717,7 @@ void Blackbox::process_event(XEvent *e) {
|
|||
win->maximize(2); // vert
|
||||
}
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_maximized_horz)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_maximized_horz)) {
|
||||
if (win->isMaximizedVert()) {
|
||||
win->maximize(0); // unmaximize
|
||||
win->maximize(1); // full
|
||||
|
@ -726,25 +725,25 @@ void Blackbox::process_event(XEvent *e) {
|
|||
win->maximize(3); // horiz
|
||||
}
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_shaded)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_shaded)) {
|
||||
if (! win->isShaded())
|
||||
win->shade();
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_skip_taskbar)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_skip_taskbar)) {
|
||||
win->setSkipTaskbar(True);
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_skip_pager)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_skip_pager)) {
|
||||
win->setSkipPager(True);
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_fullscreen)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_fullscreen)) {
|
||||
win->setFullscreen(True);
|
||||
}
|
||||
} else if (action == 0) {
|
||||
// REMOVE
|
||||
if (state[i] == xatom->getAtom(OBAtom::net_wm_state_modal)) {
|
||||
if (state[i] == xatom->atom(otk::OBProperty::net_wm_state_modal)) {
|
||||
win->setModal(False);
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_maximized_vert)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_maximized_vert)) {
|
||||
if (win->isMaximizedFull()) {
|
||||
win->maximize(0); // unmaximize
|
||||
win->maximize(3); // horiz
|
||||
|
@ -752,7 +751,7 @@ void Blackbox::process_event(XEvent *e) {
|
|||
win->maximize(0); // unmaximize
|
||||
}
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_maximized_horz)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_maximized_horz)) {
|
||||
if (win->isMaximizedFull()) {
|
||||
win->maximize(0); // unmaximize
|
||||
win->maximize(2); // vert
|
||||
|
@ -760,25 +759,25 @@ void Blackbox::process_event(XEvent *e) {
|
|||
win->maximize(0); // unmaximize
|
||||
}
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_shaded)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_shaded)) {
|
||||
if (win->isShaded())
|
||||
win->shade();
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_skip_taskbar)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_skip_taskbar)) {
|
||||
win->setSkipTaskbar(False);
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_skip_pager)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_skip_pager)) {
|
||||
win->setSkipPager(False);
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_fullscreen)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_fullscreen)) {
|
||||
win->setFullscreen(False);
|
||||
}
|
||||
} else if (action == 2) {
|
||||
// TOGGLE
|
||||
if (state[i] == xatom->getAtom(OBAtom::net_wm_state_modal)) {
|
||||
if (state[i] == xatom->atom(otk::OBProperty::net_wm_state_modal)) {
|
||||
win->setModal(! win->isModal());
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_maximized_vert)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_maximized_vert)) {
|
||||
if (win->isMaximizedFull()) {
|
||||
win->maximize(0); // unmaximize
|
||||
win->maximize(3); // horiz
|
||||
|
@ -791,7 +790,7 @@ void Blackbox::process_event(XEvent *e) {
|
|||
win->maximize(2); // vert
|
||||
}
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_maximized_horz)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_maximized_horz)) {
|
||||
if (win->isMaximizedFull()) {
|
||||
win->maximize(0); // unmaximize
|
||||
win->maximize(2); // vert
|
||||
|
@ -804,16 +803,16 @@ void Blackbox::process_event(XEvent *e) {
|
|||
win->maximize(3); // horiz
|
||||
}
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_shaded)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_shaded)) {
|
||||
win->shade();
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_skip_taskbar)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_skip_taskbar)) {
|
||||
win->setSkipTaskbar(! win->skipTaskbar());
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_skip_pager)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_skip_pager)) {
|
||||
win->setSkipPager(! win->skipPager());
|
||||
} else if (state[i] ==
|
||||
xatom->getAtom(OBAtom::net_wm_state_fullscreen)) {
|
||||
xatom->atom(otk::OBProperty::net_wm_state_fullscreen)) {
|
||||
win->setFullscreen(! win->isFullscreen());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,10 +26,10 @@ extern "C" {
|
|||
#include <string>
|
||||
|
||||
#include "otk/timer.hh"
|
||||
#include "otk/property.hh"
|
||||
#include "openbox.hh"
|
||||
#include "configuration.hh"
|
||||
#include "timer.hh"
|
||||
#include "atom.hh"
|
||||
|
||||
#define AttribShaded (1l << 0)
|
||||
#define AttribMaxHoriz (1l << 1)
|
||||
|
@ -112,7 +112,7 @@ private:
|
|||
BlackboxWindow *focused_window, *changing_window;
|
||||
otk::OBTimer *timer;
|
||||
Configuration config;
|
||||
OBAtom *xatom;
|
||||
otk::OBProperty *xatom;
|
||||
|
||||
bool no_focus, reconfigure_wait;
|
||||
Time last_time;
|
||||
|
@ -158,7 +158,7 @@ public:
|
|||
void removeWindowSearch(Window window);
|
||||
void removeGroupSearch(Window window);
|
||||
|
||||
inline OBAtom *getXAtom(void) { return xatom; }
|
||||
inline otk::OBProperty *getXAtom(void) { return xatom; }
|
||||
|
||||
inline BlackboxWindow *getFocusedWindow(void) { return focused_window; }
|
||||
inline BlackboxWindow *getChangingWindow(void) { return changing_window; }
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "../version.h"
|
||||
#include "openbox.hh"
|
||||
#include "otk/property.hh"
|
||||
#include "otk/display.hh"
|
||||
|
||||
extern "C" {
|
||||
|
@ -40,7 +41,6 @@ extern "C" {
|
|||
|
||||
namespace ob {
|
||||
|
||||
|
||||
Openbox *Openbox::instance = (Openbox *) 0;
|
||||
|
||||
|
||||
|
@ -95,7 +95,8 @@ Openbox::Openbox(int argc, char **argv)
|
|||
sigaction(SIGINT, &action, (struct sigaction *) 0);
|
||||
sigaction(SIGHUP, &action, (struct sigaction *) 0);
|
||||
|
||||
|
||||
_property = new otk::OBProperty();
|
||||
|
||||
|
||||
_state = State_Normal; // done starting
|
||||
}
|
||||
|
|
|
@ -15,8 +15,8 @@ extern "C" {
|
|||
|
||||
#include "otk/screeninfo.hh"
|
||||
#include "otk/timerqueuemanager.hh"
|
||||
#include "otk/property.hh"
|
||||
#include "xeventhandler.hh"
|
||||
#include "atom.hh"
|
||||
|
||||
namespace ob {
|
||||
|
||||
|
@ -74,6 +74,14 @@ private:
|
|||
//! The class which will handle raw XEvents
|
||||
OBXEventHandler _xeventhandler;
|
||||
|
||||
//! Cached atoms on the display
|
||||
/*!
|
||||
This is a pointer because the OBProperty class uses otk::OBDisplay::display
|
||||
in its constructor, so, it needs to be initialized <b>after</b> the display
|
||||
is initialized in this class' constructor.
|
||||
*/
|
||||
otk::OBProperty *_property;
|
||||
|
||||
//! The running state of the window manager
|
||||
RunState _state;
|
||||
|
||||
|
|
|
@ -64,7 +64,6 @@ using std::string;
|
|||
#include "bbwindow.hh"
|
||||
#include "workspace.hh"
|
||||
#include "util.hh"
|
||||
#include "atom.hh"
|
||||
|
||||
#ifndef FONT_ELEMENT_SIZE
|
||||
#define FONT_ELEMENT_SIZE 50
|
||||
|
@ -112,18 +111,18 @@ BScreen::BScreen(Blackbox *bb, unsigned int scrn) : ScreenInfo(scrn) {
|
|||
|
||||
geom_pixmap = None;
|
||||
|
||||
xatom->setSupported(this); // set-up netwm support
|
||||
// xatom->setSupported(this); // set-up netwm support
|
||||
#ifdef HAVE_GETPID
|
||||
xatom->setValue(getRootWindow(), XAtom::blackbox_pid, XAtom::cardinal,
|
||||
xatom->setValue(getRootWindow(), otk::OBProperty::blackbox_pid, otk::OBProperty::cardinal,
|
||||
(unsigned long) getpid());
|
||||
#endif // HAVE_GETPID
|
||||
unsigned long geometry[] = { getWidth(),
|
||||
getHeight()};
|
||||
xatom->setValue(getRootWindow(), OBAtom::net_desktop_geometry,
|
||||
OBAtom::cardinal, geometry, 2);
|
||||
xatom->set(getRootWindow(), otk::OBProperty::net_desktop_geometry,
|
||||
otk::OBProperty::Atom_Cardinal, geometry, 2);
|
||||
unsigned long viewport[] = {0,0};
|
||||
xatom->setValue(getRootWindow(), OBAtom::net_desktop_viewport,
|
||||
OBAtom::cardinal, viewport, 2);
|
||||
xatom->set(getRootWindow(), otk::OBProperty::net_desktop_viewport,
|
||||
otk::OBProperty::Atom_Cardinal, viewport, 2);
|
||||
|
||||
|
||||
XDefineCursor(otk::OBDisplay::display, getRootWindow(),
|
||||
|
@ -194,8 +193,8 @@ BScreen::BScreen(Blackbox *bb, unsigned int scrn) : ScreenInfo(scrn) {
|
|||
|
||||
current_workspace = workspacesList.front();
|
||||
|
||||
xatom->setValue(getRootWindow(), OBAtom::net_current_desktop,
|
||||
OBAtom::cardinal, 0); //first workspace
|
||||
xatom->set(getRootWindow(), otk::OBProperty::net_current_desktop,
|
||||
otk::OBProperty::Atom_Cardinal, 0); //first workspace
|
||||
|
||||
raiseWindows(0, 0); // this also initializes the empty stacking list
|
||||
|
||||
|
@ -630,7 +629,7 @@ void BScreen::load_rc(void) {
|
|||
resource.col_direction = TopBottom;
|
||||
|
||||
if (config->getValue(screenstr + "workspaceNames", s)) {
|
||||
OBAtom::StringVect workspaceNames;
|
||||
otk::OBProperty::StringVect workspaceNames;
|
||||
|
||||
string::const_iterator it = s.begin(), end = s.end();
|
||||
while(1) {
|
||||
|
@ -642,8 +641,8 @@ void BScreen::load_rc(void) {
|
|||
++it;
|
||||
}
|
||||
|
||||
xatom->setValue(getRootWindow(), OBAtom::net_desktop_names, OBAtom::utf8,
|
||||
workspaceNames);
|
||||
xatom->set(getRootWindow(), otk::OBProperty::net_desktop_names,
|
||||
otk::OBProperty::utf8, workspaceNames);
|
||||
}
|
||||
|
||||
resource.sloppy_focus = true;
|
||||
|
@ -1014,8 +1013,8 @@ void BScreen::changeWorkspaceID(unsigned int id) {
|
|||
|
||||
current_workspace = getWorkspace(id);
|
||||
|
||||
xatom->setValue(getRootWindow(), OBAtom::net_current_desktop,
|
||||
OBAtom::cardinal, id);
|
||||
xatom->set(getRootWindow(), otk::OBProperty::net_current_desktop,
|
||||
otk::OBProperty::Atom_Cardinal, id);
|
||||
|
||||
current_workspace->showAll();
|
||||
|
||||
|
@ -1069,12 +1068,12 @@ void BScreen::updateClientList(void) {
|
|||
const BlackboxWindowList::iterator end = windowList.end();
|
||||
for (; it != end; ++it, ++win_it)
|
||||
*win_it = (*it)->getClientWindow();
|
||||
xatom->setValue(getRootWindow(), OBAtom::net_client_list, OBAtom::window,
|
||||
windows, windowList.size());
|
||||
xatom->set(getRootWindow(), otk::OBProperty::net_client_list,
|
||||
otk::OBProperty::Atom_Window, windows, windowList.size());
|
||||
delete [] windows;
|
||||
} else
|
||||
xatom->setValue(getRootWindow(), OBAtom::net_client_list, OBAtom::window,
|
||||
0, 0);
|
||||
xatom->set(getRootWindow(), otk::OBProperty::net_client_list,
|
||||
otk::OBProperty::Atom_Window, 0, 0);
|
||||
|
||||
updateStackingList();
|
||||
}
|
||||
|
@ -1106,12 +1105,12 @@ void BScreen::updateStackingList(void) {
|
|||
end = stack_order.end();
|
||||
for (; it != end; ++it, ++win_it)
|
||||
*win_it = (*it)->getClientWindow();
|
||||
xatom->setValue(getRootWindow(), OBAtom::net_client_list_stacking,
|
||||
OBAtom::window, windows, stack_order.size());
|
||||
xatom->set(getRootWindow(), otk::OBProperty::net_client_list_stacking,
|
||||
otk::OBProperty::Atom_Window, windows, stack_order.size());
|
||||
delete [] windows;
|
||||
} else
|
||||
xatom->setValue(getRootWindow(), OBAtom::net_client_list_stacking,
|
||||
OBAtom::window, 0, 0);
|
||||
xatom->set(getRootWindow(), otk::OBProperty::net_client_list_stacking,
|
||||
otk::OBProperty::Atom_Window, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1120,9 +1119,9 @@ void BScreen::addSystrayWindow(Window window) {
|
|||
|
||||
XSelectInput(otk::OBDisplay::display, window, StructureNotifyMask);
|
||||
systrayWindowList.push_back(window);
|
||||
xatom->setValue(getRootWindow(), OBAtom::kde_net_system_tray_windows,
|
||||
OBAtom::window,
|
||||
&systrayWindowList[0], systrayWindowList.size());
|
||||
xatom->set(getRootWindow(), otk::OBProperty::kde_net_system_tray_windows,
|
||||
otk::OBProperty::Atom_Window,
|
||||
&systrayWindowList[0], systrayWindowList.size());
|
||||
blackbox->saveSystrayWindowSearch(window, this);
|
||||
|
||||
XUngrabServer(otk::OBDisplay::display);
|
||||
|
@ -1137,9 +1136,10 @@ void BScreen::removeSystrayWindow(Window window) {
|
|||
for (; it != end; ++it)
|
||||
if (*it == window) {
|
||||
systrayWindowList.erase(it);
|
||||
xatom->setValue(getRootWindow(), OBAtom::kde_net_system_tray_windows,
|
||||
OBAtom::window,
|
||||
&systrayWindowList[0], systrayWindowList.size());
|
||||
xatom->set(getRootWindow(),
|
||||
otk::OBProperty::kde_net_system_tray_windows,
|
||||
otk::OBProperty::Atom_Window,
|
||||
&systrayWindowList[0], systrayWindowList.size());
|
||||
blackbox->removeSystrayWindowSearch(window);
|
||||
XSelectInput(otk::OBDisplay::display, window, NoEventMask);
|
||||
break;
|
||||
|
@ -1154,8 +1154,10 @@ void BScreen::removeSystrayWindow(Window window) {
|
|||
void BScreen::manageWindow(Window w) {
|
||||
// is the window a KDE systray window?
|
||||
Window systray;
|
||||
if (xatom->getValue(w, OBAtom::kde_net_wm_system_tray_window_for,
|
||||
OBAtom::window, systray) && systray != None) {
|
||||
if (xatom->get(w, otk::OBProperty::kde_net_wm_system_tray_window_for,
|
||||
otk::OBProperty::Atom_Window, &systray) &&
|
||||
systray != None)
|
||||
{
|
||||
addSystrayWindow(w);
|
||||
return;
|
||||
}
|
||||
|
@ -1197,9 +1199,11 @@ void BScreen::manageWindow(Window w) {
|
|||
void BScreen::unmanageWindow(BlackboxWindow *w, bool remap) {
|
||||
// is the window a KDE systray window?
|
||||
Window systray;
|
||||
if (xatom->getValue(w->getClientWindow(),
|
||||
OBAtom::kde_net_wm_system_tray_window_for,
|
||||
OBAtom::window, systray) && systray != None) {
|
||||
if (xatom->get(w->getClientWindow(),
|
||||
otk::OBProperty::kde_net_wm_system_tray_window_for,
|
||||
otk::OBProperty::Atom_Window, &systray) &&
|
||||
systray != None)
|
||||
{
|
||||
removeSystrayWindow(w->getClientWindow());
|
||||
return;
|
||||
}
|
||||
|
@ -1271,18 +1275,19 @@ void BScreen::updateWorkArea(void) {
|
|||
dims[(i * 4) + 2] = area.width();
|
||||
dims[(i * 4) + 3] = area.height();
|
||||
}
|
||||
xatom->setValue(getRootWindow(), OBAtom::net_workarea, OBAtom::cardinal,
|
||||
dims, 4 * workspacesList.size());
|
||||
xatom->set(getRootWindow(), otk::OBProperty::net_workarea,
|
||||
otk::OBProperty::Atom_Cardinal,
|
||||
dims, 4 * workspacesList.size());
|
||||
delete [] dims;
|
||||
} else
|
||||
xatom->setValue(getRootWindow(), OBAtom::net_workarea, OBAtom::cardinal,
|
||||
0, 0);
|
||||
xatom->set(getRootWindow(), otk::OBProperty::net_workarea,
|
||||
otk::OBProperty::Atom_Cardinal, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
void BScreen::updateNetizenWorkspaceCount(void) {
|
||||
xatom->setValue(getRootWindow(), OBAtom::net_number_of_desktops,
|
||||
OBAtom::cardinal, workspacesList.size());
|
||||
xatom->set(getRootWindow(), otk::OBProperty::net_number_of_desktops,
|
||||
otk::OBProperty::Atom_Cardinal, workspacesList.size());
|
||||
|
||||
updateWorkArea();
|
||||
}
|
||||
|
@ -1292,8 +1297,8 @@ void BScreen::updateNetizenWindowFocus(void) {
|
|||
Window f = ((blackbox->getFocusedWindow()) ?
|
||||
blackbox->getFocusedWindow()->getClientWindow() : None);
|
||||
|
||||
xatom->setValue(getRootWindow(), OBAtom::net_active_window,
|
||||
OBAtom::window, f);
|
||||
xatom->set(getRootWindow(), otk::OBProperty::net_active_window,
|
||||
otk::OBProperty::Atom_Window, f);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1641,7 +1646,7 @@ void BScreen::buttonPressEvent(const XButtonEvent *xbutton) {
|
|||
|
||||
|
||||
void BScreen::propertyNotifyEvent(const XPropertyEvent *pe) {
|
||||
if (pe->atom == xatom->getAtom(OBAtom::net_desktop_names)) {
|
||||
if (pe->atom == xatom->atom(otk::OBProperty::net_desktop_names)) {
|
||||
// _NET_WM_DESKTOP_NAMES
|
||||
WorkspaceList::iterator it = workspacesList.begin();
|
||||
const WorkspaceList::iterator end = workspacesList.end();
|
||||
|
|
|
@ -24,13 +24,13 @@ extern "C" {
|
|||
#include "otk/font.hh"
|
||||
#include "otk/texture.hh"
|
||||
#include "otk/image.hh"
|
||||
#include "otk/property.hh"
|
||||
#include "timer.hh"
|
||||
#include "workspace.hh"
|
||||
#include "blackbox.hh"
|
||||
|
||||
namespace ob {
|
||||
|
||||
class OBAtom;
|
||||
struct Strut;
|
||||
|
||||
enum TextJustify { LeftJustify = 1, RightJustify, CenterJustify };
|
||||
|
@ -66,7 +66,7 @@ private:
|
|||
Blackbox *blackbox;
|
||||
otk::BImageControl *image_control;
|
||||
Configuration *config;
|
||||
OBAtom *xatom;
|
||||
otk::OBProperty *xatom;
|
||||
|
||||
BlackboxWindowList iconList, windowList;
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@ using std::string;
|
|||
#include "util.hh"
|
||||
#include "bbwindow.hh"
|
||||
#include "workspace.hh"
|
||||
#include "atom.hh"
|
||||
|
||||
namespace ob {
|
||||
|
||||
|
@ -424,12 +423,12 @@ void Workspace::setCurrent(void) {
|
|||
|
||||
|
||||
void Workspace::readName(void) {
|
||||
OBAtom::StringVect namesList;
|
||||
otk::OBProperty::StringVect namesList;
|
||||
unsigned long numnames = id + 1;
|
||||
|
||||
// attempt to get from the _NET_WM_DESKTOP_NAMES property
|
||||
if (xatom->getValue(screen->getRootWindow(), OBAtom::net_desktop_names,
|
||||
OBAtom::utf8, numnames, namesList) &&
|
||||
if (xatom->get(screen->getRootWindow(), otk::OBProperty::net_desktop_names,
|
||||
otk::OBProperty::utf8, &numnames, &namesList) &&
|
||||
namesList.size() > id) {
|
||||
name = namesList[id];
|
||||
|
||||
|
@ -451,17 +450,18 @@ void Workspace::readName(void) {
|
|||
|
||||
void Workspace::setName(const string& new_name) {
|
||||
// set the _NET_WM_DESKTOP_NAMES property with the new name
|
||||
OBAtom::StringVect namesList;
|
||||
otk::OBProperty::StringVect namesList;
|
||||
unsigned long numnames = (unsigned) -1;
|
||||
if (xatom->getValue(screen->getRootWindow(), OBAtom::net_desktop_names,
|
||||
OBAtom::utf8, numnames, namesList) &&
|
||||
if (xatom->get(screen->getRootWindow(),
|
||||
otk::OBProperty::net_desktop_names,
|
||||
otk::OBProperty::utf8, &numnames, &namesList) &&
|
||||
namesList.size() > id)
|
||||
namesList[id] = new_name;
|
||||
else
|
||||
namesList.push_back(new_name);
|
||||
|
||||
xatom->setValue(screen->getRootWindow(), OBAtom::net_desktop_names,
|
||||
OBAtom::utf8, namesList);
|
||||
xatom->set(screen->getRootWindow(), otk::OBProperty::net_desktop_names,
|
||||
otk::OBProperty::utf8, namesList);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ extern "C" {
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "atom.hh"
|
||||
#include "otk/property.hh"
|
||||
|
||||
namespace ob {
|
||||
|
||||
|
@ -25,7 +25,7 @@ class Workspace {
|
|||
private:
|
||||
BScreen *screen;
|
||||
BlackboxWindow *lastfocus;
|
||||
OBAtom *xatom;
|
||||
otk::OBProperty *xatom;
|
||||
|
||||
BlackboxWindowList stackingList, windowList;
|
||||
|
||||
|
|
Loading…
Reference in a new issue