aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/AttentionNoticeHandler.cc17
-rw-r--r--src/AttentionNoticeHandler.hh2
-rw-r--r--src/Ewmh.cc12
-rw-r--r--src/WinButtonTheme.cc3
-rw-r--r--src/WinClient.cc17
-rw-r--r--src/Window.cc12
6 files changed, 44 insertions, 19 deletions
diff --git a/src/AttentionNoticeHandler.cc b/src/AttentionNoticeHandler.cc
index fec3933..3f28695 100644
--- a/src/AttentionNoticeHandler.cc
+++ b/src/AttentionNoticeHandler.cc
@@ -23,7 +23,7 @@
23 23
24#include "AttentionNoticeHandler.hh" 24#include "AttentionNoticeHandler.hh"
25 25
26#include "Focusable.hh" 26#include "Window.hh"
27#include "Screen.hh" 27#include "Screen.hh"
28#include "STLUtil.hh" 28#include "STLUtil.hh"
29 29
@@ -94,12 +94,16 @@ void AttentionNoticeHandler::addAttention(Focusable &client) {
94 // attach signals that will make notice go away 94 // attach signals that will make notice go away
95 client.dieSig().attach(this); 95 client.dieSig().attach(this);
96 client.focusSig().attach(this); 96 client.focusSig().attach(this);
97
98 // update _NET_WM_STATE atom
99 if (client.fbwindow())
100 client.fbwindow()->stateSig().notify();
97} 101}
98 102
99void AttentionNoticeHandler::update(FbTk::Subject *subj) { 103void AttentionNoticeHandler::update(FbTk::Subject *subj) {
100 104
101 // we need to be able to get the window 105 // we need to be able to get the window
102 if (typeid(*subj) != typeid(Focusable::FocusSubject)) 106 if (!subj || typeid(*subj) != typeid(Focusable::FocusSubject))
103 return; 107 return;
104 108
105 // all signals results in destruction of the notice 109 // all signals results in destruction of the notice
@@ -109,5 +113,14 @@ void AttentionNoticeHandler::update(FbTk::Subject *subj) {
109 delete m_attentions[&winsubj->win()]; 113 delete m_attentions[&winsubj->win()];
110 m_attentions.erase(&winsubj->win()); 114 m_attentions.erase(&winsubj->win());
111 winsubj->win().setAttentionState(false); 115 winsubj->win().setAttentionState(false);
116
117 // update _NET_WM_STATE atom
118 FluxboxWindow *fbwin = winsubj->win().fbwindow();
119 if (fbwin && winsubj != &winsubj->win().dieSig())
120 fbwin->stateSig().notify();
121
112} 122}
113 123
124bool AttentionNoticeHandler::isDemandingAttention(Focusable &client) {
125 return m_attentions.find(&client) != m_attentions.end();
126}
diff --git a/src/AttentionNoticeHandler.hh b/src/AttentionNoticeHandler.hh
index ddef42d..ed2245d 100644
--- a/src/AttentionNoticeHandler.hh
+++ b/src/AttentionNoticeHandler.hh
@@ -47,6 +47,8 @@ public:
47 void addAttention(Focusable &client); 47 void addAttention(Focusable &client);
48 /// removes the client from the attention map 48 /// removes the client from the attention map
49 void update(FbTk::Subject *subj); 49 void update(FbTk::Subject *subj);
50
51 bool isDemandingAttention(Focusable &client);
50 52
51private: 53private:
52 NoticeMap m_attentions; 54 NoticeMap m_attentions;
diff --git a/src/Ewmh.cc b/src/Ewmh.cc
index 3ff4e76..afa138c 100644
--- a/src/Ewmh.cc
+++ b/src/Ewmh.cc
@@ -622,21 +622,25 @@ 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().isStateModal())
626 state.push_back(m_net_wm_state_modal);
627 625
628 FluxboxWindow::ClientList::iterator it = win.clientList().begin(); 626 FluxboxWindow::ClientList::iterator it = win.clientList().begin();
629 FluxboxWindow::ClientList::iterator it_end = win.clientList().end(); 627 FluxboxWindow::ClientList::iterator it_end = win.clientList().end();
630 for (; it != it_end; ++it) { 628 for (; it != it_end; ++it) {
631 629
632 // search the old states for _NET_WM_STATE_SKIP_PAGER and append it
633 // to the current state, so it wont get deleted by us.
634 StateVec client_state(state); 630 StateVec client_state(state);
635 Atom ret_type; 631 Atom ret_type;
636 int fmt; 632 int fmt;
637 unsigned long nitems, bytes_after; 633 unsigned long nitems, bytes_after;
638 unsigned char *data = 0; 634 unsigned char *data = 0;
639 635
636 // set client-specific state
637 if ((*it)->isStateModal())
638 client_state.push_back(m_net_wm_state_modal);
639 if (Fluxbox::instance()->attentionHandler().isDemandingAttention(**it))
640 client_state.push_back(m_net_wm_state_demands_attention);
641
642 // search the old states for _NET_WM_STATE_SKIP_PAGER and append it
643 // to the current state, so it wont get deleted by us.
640 (*it)->property(m_net_wm_state, 0, 0x7fffffff, False, XA_ATOM, 644 (*it)->property(m_net_wm_state, 0, 0x7fffffff, False, XA_ATOM,
641 &ret_type, &fmt, &nitems, &bytes_after, 645 &ret_type, &fmt, &nitems, &bytes_after,
642 &data); 646 &data);
diff --git a/src/WinButtonTheme.cc b/src/WinButtonTheme.cc
index 22e86fc..fa8e50f 100644
--- a/src/WinButtonTheme.cc
+++ b/src/WinButtonTheme.cc
@@ -67,7 +67,8 @@ WinButtonTheme::~WinButtonTheme() {
67void WinButtonTheme::reconfigTheme() { 67void WinButtonTheme::reconfigTheme() {
68 // rescale the pixmaps to match frame theme height 68 // rescale the pixmaps to match frame theme height
69 69
70 unsigned int size = m_frame_theme.titleHeight(); 70 unsigned int size = m_frame_theme.titleHeight()
71 - 2 * m_frame_theme.bevelWidth();;
71 if (m_frame_theme.titleHeight() == 0) { 72 if (m_frame_theme.titleHeight() == 0) {
72 // calculate height from font and border width to scale pixmaps 73 // calculate height from font and border width to scale pixmaps
73 size = m_frame_theme.font().height() + 2; 74 size = m_frame_theme.font().height() + 2;
diff --git a/src/WinClient.cc b/src/WinClient.cc
index b731c34..ddf0599 100644
--- a/src/WinClient.cc
+++ b/src/WinClient.cc
@@ -126,14 +126,6 @@ WinClient::~WinClient() {
126 126
127 clearStrut(); 127 clearStrut();
128 128
129 if (fbwindow() != 0)
130 fbwindow()->removeClient(*this);
131
132 // this takes care of any focus issues
133 m_diesig.notify();
134
135 Fluxbox *fluxbox = Fluxbox::instance();
136
137 // 129 //
138 // clear transients and transient_for 130 // clear transients and transient_for
139 // 131 //
@@ -149,6 +141,15 @@ WinClient::~WinClient() {
149 transients.back()->transient_for = 0; 141 transients.back()->transient_for = 0;
150 transients.pop_back(); 142 transients.pop_back();
151 } 143 }
144
145 if (fbwindow() != 0)
146 fbwindow()->removeClient(*this);
147
148 // this takes care of any focus issues
149 m_diesig.notify();
150
151 Fluxbox *fluxbox = Fluxbox::instance();
152
152 // This fixes issue 1 (see WinClient.hh): 153 // This fixes issue 1 (see WinClient.hh):
153 // If transients die before the transient_for is created 154 // If transients die before the transient_for is created
154 removeTransientFromWaitingList(); 155 removeTransientFromWaitingList();
diff --git a/src/Window.cc b/src/Window.cc
index 5c27c45..4ddd8c8 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1002,6 +1002,11 @@ bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) {
1002 if (client.fbwindow() != this) 1002 if (client.fbwindow() != this)
1003 return false; 1003 return false;
1004 1004
1005 IconButton *button = m_labelbuttons[&client];
1006 // in case the window is being destroyed, but this should never happen
1007 if (!button)
1008 return false;
1009
1005 m_client = &client; 1010 m_client = &client;
1006 m_client->raise(); 1011 m_client->raise();
1007 m_client->focusSig().notify(); 1012 m_client->focusSig().notify();
@@ -1009,10 +1014,10 @@ bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) {
1009 1014
1010#ifdef DEBUG 1015#ifdef DEBUG
1011 cerr<<"FluxboxWindow::"<<__FUNCTION__<<": labelbutton[client] = "<< 1016 cerr<<"FluxboxWindow::"<<__FUNCTION__<<": labelbutton[client] = "<<
1012 m_labelbuttons[m_client]<<endl; 1017 button<<endl;
1013#endif // DEBUG 1018#endif // DEBUG
1014 // frame focused doesn't necessarily mean input focused 1019 // frame focused doesn't necessarily mean input focused
1015 frame().setLabelButtonFocus(*m_labelbuttons[m_client]); 1020 frame().setLabelButtonFocus(*button);
1016 1021
1017 return setinput && focus(); 1022 return setinput && focus();
1018} 1023}
@@ -2379,8 +2384,7 @@ bool FluxboxWindow::allowsFocusFromClient() {
2379 2384
2380 FluxboxWindow *cur = FocusControl::focusedFbWindow(); 2385 FluxboxWindow *cur = FocusControl::focusedFbWindow();
2381 WinClient *client = FocusControl::focusedWindow(); 2386 WinClient *client = FocusControl::focusedWindow();
2382 if (cur && client && cur->isTyping() && (!client->window_group || 2387 if (cur && client && cur->isTyping() &&
2383 client->window_group != m_client->window_group) &&
2384 getRootTransientFor(m_client) != getRootTransientFor(client)) 2388 getRootTransientFor(m_client) != getRootTransientFor(client))
2385 return false; 2389 return false;
2386 2390