aboutsummaryrefslogtreecommitdiff
path: root/src/Ewmh.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-06-30 17:06:29 (GMT)
committermarkt <markt>2007-06-30 17:06:29 (GMT)
commit103b55e600aff58000ed09ff2b601daf97164167 (patch)
treeb058cb0737654556daa95a7fcace87313c3b511f /src/Ewmh.cc
parent998b23acf220f7bfa2117f8446a4f3a179b32d0a (diff)
downloadfluxbox-103b55e600aff58000ed09ff2b601daf97164167.zip
fluxbox-103b55e600aff58000ed09ff2b601daf97164167.tar.bz2
fix support for _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 99a8759..3ff4e76 100644
--- a/src/Ewmh.cc
+++ b/src/Ewmh.cc
@@ -622,7 +622,7 @@ void Ewmh::updateState(FluxboxWindow &win) {
622 state.push_back(m_net_wm_state_skip_taskbar); 622 state.push_back(m_net_wm_state_skip_taskbar);
623 if (win.isFullscreen()) 623 if (win.isFullscreen())
624 state.push_back(m_net_wm_state_fullscreen); 624 state.push_back(m_net_wm_state_fullscreen);
625 if (win.winClient().isModal()) 625 if (win.winClient().isStateModal())
626 state.push_back(m_net_wm_state_modal); 626 state.push_back(m_net_wm_state_modal);
627 627
628 FluxboxWindow::ClientList::iterator it = win.clientList().begin(); 628 FluxboxWindow::ClientList::iterator it = win.clientList().begin();
@@ -1004,12 +1004,16 @@ void Ewmh::createAtoms() {
1004 utf8_string = XInternAtom(disp, "UTF8_STRING", False); 1004 utf8_string = XInternAtom(disp, "UTF8_STRING", False);
1005} 1005}
1006 1006
1007// wrapper for avoiding changing every AtomHandler to include an unnecessary 1007// wrapper for real setState, since most operations don't need the client
1008// parameter, although we need it for _NET_WM_STATE_DEMANDS_ATTENTION
1009void Ewmh::setState(FluxboxWindow &win, Atom state, bool value) { 1008void Ewmh::setState(FluxboxWindow &win, Atom state, bool value) {
1010 setState(win, state, value, win.winClient()); 1009 setState(win, state, value, win.winClient());
1011} 1010}
1012 1011
1012// wrapper for real toggleState, since most operations don't need the client
1013void Ewmh::toggleState(FluxboxWindow &win, Atom state) {
1014 toggleState(win, state, win.winClient());
1015}
1016
1013// set window state 1017// set window state
1014void Ewmh::setState(FluxboxWindow &win, Atom state, bool value, 1018void Ewmh::setState(FluxboxWindow &win, Atom state, bool value,
1015 WinClient &client) { 1019 WinClient &client) {
@@ -1057,13 +1061,14 @@ void Ewmh::setState(FluxboxWindow &win, Atom state, bool value,
1057 Fluxbox::instance()->attentionHandler(). 1061 Fluxbox::instance()->attentionHandler().
1058 update(&client.focusSig()); 1062 update(&client.focusSig());
1059 } 1063 }
1064 } else if (state == m_net_wm_state_modal) {
1065 client.setStateModal(value);
1060 } 1066 }
1061 1067
1062 // Note: state == net_wm_state_modal, We should not change it
1063} 1068}
1064 1069
1065// toggle window state 1070// toggle window state
1066void Ewmh::toggleState(FluxboxWindow &win, Atom state) { 1071void Ewmh::toggleState(FluxboxWindow &win, Atom state, WinClient &client) {
1067 if (state == m_net_wm_state_sticky) { // sticky 1072 if (state == m_net_wm_state_sticky) { // sticky
1068 win.stick(); 1073 win.stick();
1069 } else if (state == m_net_wm_state_shaded){ // shaded 1074 } else if (state == m_net_wm_state_shaded){ // shaded
@@ -1092,6 +1097,8 @@ void Ewmh::toggleState(FluxboxWindow &win, Atom state) {
1092 win.moveToLayer(Layer::NORMAL); 1097 win.moveToLayer(Layer::NORMAL);
1093 else 1098 else
1094 win.moveToLayer(Layer::ABOVE_DOCK); 1099 win.moveToLayer(Layer::ABOVE_DOCK);
1100 } else if (state == m_net_wm_state_modal) { // modal
1101 client.setStateModal(!client.isStateModal());
1095 } 1102 }
1096 1103
1097} 1104}