diff options
author | rathnor <rathnor> | 2002-09-12 14:55:11 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2002-09-12 14:55:11 (GMT) |
commit | e54676573689d353bf53a4d6225ba1206ddf10fa (patch) | |
tree | 1f7dcc90b3613f46f469dcece4acf5ebfbe81221 /src/Window.cc | |
parent | 8a728b46fd05b872b5daf9632af478f1c098dd4f (diff) | |
download | fluxbox-e54676573689d353bf53a4d6225ba1206ddf10fa.zip fluxbox-e54676573689d353bf53a4d6225ba1206ddf10fa.tar.bz2 |
Fixes to sticky window + focus handling. Particularly for
next/prevFocus crashes. Also, sticky windows are now always reassociated
to the active workspace.
Diffstat (limited to 'src/Window.cc')
-rw-r--r-- | src/Window.cc | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/Window.cc b/src/Window.cc index 8ec14e3..019ccb4 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Window.cc,v 1.85 2002/09/11 15:12:40 fluxgen Exp $ | 25 | // $Id: Window.cc,v 1.86 2002/09/12 14:55:11 rathnor Exp $ |
26 | 26 | ||
27 | #include "Window.hh" | 27 | #include "Window.hh" |
28 | 28 | ||
@@ -100,7 +100,7 @@ tab(0) { | |||
100 | frame.utitle = frame.ftitle = frame.uhandle = frame.fhandle = None; | 100 | frame.utitle = frame.ftitle = frame.uhandle = frame.fhandle = None; |
101 | frame.ulabel = frame.flabel = frame.ubutton = frame.fbutton = None; | 101 | frame.ulabel = frame.flabel = frame.ubutton = frame.fbutton = None; |
102 | frame.pbutton = frame.ugrip = frame.fgrip = None; | 102 | frame.pbutton = frame.ugrip = frame.fgrip = None; |
103 | 103 | ||
104 | //get decorations | 104 | //get decorations |
105 | vector<Fluxbox::Titlebar> dir = fluxbox->getTitlebarLeft(); | 105 | vector<Fluxbox::Titlebar> dir = fluxbox->getTitlebarLeft(); |
106 | for (char c=0; c<2; c++) { | 106 | for (char c=0; c<2; c++) { |
@@ -164,7 +164,7 @@ tab(0) { | |||
164 | fluxbox->ungrab(); | 164 | fluxbox->ungrab(); |
165 | return; | 165 | return; |
166 | } | 166 | } |
167 | 167 | ||
168 | image_ctrl = screen->getImageControl(); | 168 | image_ctrl = screen->getImageControl(); |
169 | 169 | ||
170 | client.x = wattrib.x; | 170 | client.x = wattrib.x; |
@@ -186,7 +186,6 @@ tab(0) { | |||
186 | getWMProtocols(); | 186 | getWMProtocols(); |
187 | getWMHints(); | 187 | getWMHints(); |
188 | getWMNormalHints(); | 188 | getWMNormalHints(); |
189 | |||
190 | #ifdef SLIT | 189 | #ifdef SLIT |
191 | 190 | ||
192 | if (client.initial_state == WithdrawnState) { | 191 | if (client.initial_state == WithdrawnState) { |
@@ -219,7 +218,7 @@ tab(0) { | |||
219 | } | 218 | } |
220 | 219 | ||
221 | upsize(); | 220 | upsize(); |
222 | 221 | ||
223 | bool place_window = true; | 222 | bool place_window = true; |
224 | if (fluxbox->isStartup() || transient || | 223 | if (fluxbox->isStartup() || transient || |
225 | client.normal_hint_flags & (PPosition|USPosition)) { | 224 | client.normal_hint_flags & (PPosition|USPosition)) { |
@@ -319,11 +318,16 @@ tab(0) { | |||
319 | int m = maximized; | 318 | int m = maximized; |
320 | maximized = false; | 319 | maximized = false; |
321 | maximize(m); | 320 | maximize(m); |
321 | } | ||
322 | |||
323 | if (stuck) { | ||
324 | stuck = false; | ||
325 | stick(); | ||
326 | deiconify(); //omnipresent, so show it | ||
322 | } | 327 | } |
323 | 328 | ||
324 | setFocusFlag(false); | 329 | setFocusFlag(false); |
325 | 330 | ||
326 | |||
327 | #ifdef DEBUG | 331 | #ifdef DEBUG |
328 | fprintf(stderr, "%s(%d): FluxboxWindow(this=%p)\n", __FILE__, __LINE__, this); | 332 | fprintf(stderr, "%s(%d): FluxboxWindow(this=%p)\n", __FILE__, __LINE__, this); |
329 | #endif // DEBUG | 333 | #endif // DEBUG |
@@ -1172,7 +1176,7 @@ void FluxboxWindow::getWMProtocols() { | |||
1172 | Atom *proto; | 1176 | Atom *proto; |
1173 | int num_return = 0; | 1177 | int num_return = 0; |
1174 | Fluxbox *fluxbox = Fluxbox::instance(); | 1178 | Fluxbox *fluxbox = Fluxbox::instance(); |
1175 | 1179 | ||
1176 | if (XGetWMProtocols(display, client.window, &proto, &num_return)) { | 1180 | if (XGetWMProtocols(display, client.window, &proto, &num_return)) { |
1177 | for (int i = 0; i < num_return; ++i) { | 1181 | for (int i = 0; i < num_return; ++i) { |
1178 | if (proto[i] == fluxbox->getWMDeleteAtom()) | 1182 | if (proto[i] == fluxbox->getWMDeleteAtom()) |
@@ -2062,13 +2066,12 @@ void FluxboxWindow::stick() { | |||
2062 | 2066 | ||
2063 | stuck = false; | 2067 | stuck = false; |
2064 | 2068 | ||
2065 | if (! iconic) | ||
2066 | screen->reassociateWindow(this, screen->getCurrentWorkspace()->workspaceID(), true); | ||
2067 | |||
2068 | |||
2069 | } else { | 2069 | } else { |
2070 | stuck = true; | 2070 | stuck = true; |
2071 | 2071 | if (screen->getCurrentWorkspaceID() != workspace_number) { | |
2072 | screen->reassociateWindow(this,screen->getCurrentWorkspaceID(), true); | ||
2073 | } | ||
2074 | |||
2072 | blackbox_attrib.flags |= BaseDisplay::ATTRIB_OMNIPRESENT; | 2075 | blackbox_attrib.flags |= BaseDisplay::ATTRIB_OMNIPRESENT; |
2073 | blackbox_attrib.attrib |= BaseDisplay::ATTRIB_OMNIPRESENT; | 2076 | blackbox_attrib.attrib |= BaseDisplay::ATTRIB_OMNIPRESENT; |
2074 | 2077 | ||