aboutsummaryrefslogtreecommitdiff
path: root/src/Ewmh.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-06-30 16:54:05 (GMT)
committermarkt <markt>2007-06-30 16:54:05 (GMT)
commit0f9f19344466cf25170750f768815daf3bdfd2ae (patch)
tree65584eade13f0135102e0284b1981c3ee8ba6282 /src/Ewmh.cc
parent8e75ace959d2a5d56d30cb6a06ce895f397c1f19 (diff)
downloadfluxbox-0f9f19344466cf25170750f768815daf3bdfd2ae.zip
fluxbox-0f9f19344466cf25170750f768815daf3bdfd2ae.tar.bz2
fixed implementation of _NET_WM_STATE_MODAL
Diffstat (limited to 'src/Ewmh.cc')
-rw-r--r--src/Ewmh.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc
index b4e831d..ef2fc09 100644
--- a/src/Ewmh.cc
+++ b/src/Ewmh.cc
@@ -629,7 +629,7 @@ void Ewmh::updateState(FluxboxWindow &win) {
629 state.push_back(m_net_wm_state_skip_taskbar); 629 state.push_back(m_net_wm_state_skip_taskbar);
630 if (win.isFullscreen()) 630 if (win.isFullscreen())
631 state.push_back(m_net_wm_state_fullscreen); 631 state.push_back(m_net_wm_state_fullscreen);
632 if (win.winClient().isModal()) 632 if (win.winClient().isStateModal())
633 state.push_back(m_net_wm_state_modal); 633 state.push_back(m_net_wm_state_modal);
634 634
635 FluxboxWindow::ClientList::iterator it = win.clientList().begin(); 635 FluxboxWindow::ClientList::iterator it = win.clientList().begin();
@@ -1031,12 +1031,16 @@ void Ewmh::createAtoms() {
1031 utf8_string = XInternAtom(disp, "UTF8_STRING", False); 1031 utf8_string = XInternAtom(disp, "UTF8_STRING", False);
1032} 1032}
1033 1033
1034// wrapper for avoiding changing every AtomHandler to include an unnecessary 1034// wrapper for real setState, since most operations don't need the client
1035// parameter, although we need it for _NET_WM_STATE_DEMANDS_ATTENTION
1036void Ewmh::setState(FluxboxWindow &win, Atom state, bool value) { 1035void Ewmh::setState(FluxboxWindow &win, Atom state, bool value) {
1037 setState(win, state, value, win.winClient()); 1036 setState(win, state, value, win.winClient());
1038} 1037}
1039 1038
1039// wrapper for real toggleState, since most operations don't need the client
1040void Ewmh::toggleState(FluxboxWindow &win, Atom state) {
1041 toggleState(win, state, win.winClient());
1042}
1043
1040// set window state 1044// set window state
1041void Ewmh::setState(FluxboxWindow &win, Atom state, bool value, 1045void Ewmh::setState(FluxboxWindow &win, Atom state, bool value,
1042 WinClient &client) { 1046 WinClient &client) {
@@ -1084,13 +1088,14 @@ void Ewmh::setState(FluxboxWindow &win, Atom state, bool value,
1084 Fluxbox::instance()->attentionHandler(). 1088 Fluxbox::instance()->attentionHandler().
1085 update(&client.focusSig()); 1089 update(&client.focusSig());
1086 } 1090 }
1091 } else if (state == m_net_wm_state_modal) {
1092 client.setStateModal(value);
1087 } 1093 }
1088 1094
1089 // Note: state == net_wm_state_modal, We should not change it
1090} 1095}
1091 1096
1092// toggle window state 1097// toggle window state
1093void Ewmh::toggleState(FluxboxWindow &win, Atom state) { 1098void Ewmh::toggleState(FluxboxWindow &win, Atom state, WinClient &client) {
1094 if (state == m_net_wm_state_sticky) { // sticky 1099 if (state == m_net_wm_state_sticky) { // sticky
1095 win.stick(); 1100 win.stick();
1096 } else if (state == m_net_wm_state_shaded){ // shaded 1101 } else if (state == m_net_wm_state_shaded){ // shaded
@@ -1119,6 +1124,8 @@ void Ewmh::toggleState(FluxboxWindow &win, Atom state) {
1119 win.moveToLayer(Layer::NORMAL); 1124 win.moveToLayer(Layer::NORMAL);
1120 else 1125 else
1121 win.moveToLayer(Layer::ABOVE_DOCK); 1126 win.moveToLayer(Layer::ABOVE_DOCK);
1127 } else if (state == m_net_wm_state_modal) { // modal
1128 client.setStateModal(!client.isStateModal());
1122 } 1129 }
1123 1130
1124} 1131}