aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FocusControl.cc4
-rw-r--r--src/Window.cc21
2 files changed, 13 insertions, 12 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index 27ef999..b977d59 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -156,9 +156,7 @@ void FocusControl::cycleFocus(const Focusables &window_list,
156 } 156 }
157 } 157 }
158 158
159 if (isCycling()) 159 if (!isCycling())
160 fbwin->tempRaise();
161 else
162 fbwin->raise(); 160 fbwin->raise();
163 161
164 m_cycling_window = it; 162 m_cycling_window = it;
diff --git a/src/Window.cc b/src/Window.cc
index 3452ce2..5e2f7c8 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -127,7 +127,7 @@ static Bool queueScanner(Display *, XEvent *e, char *args) {
127 127
128/// returns the deepest transientFor, asserting against a close loop 128/// returns the deepest transientFor, asserting against a close loop
129WinClient *getRootTransientFor(WinClient *client) { 129WinClient *getRootTransientFor(WinClient *client) {
130 while (client->transientFor()) { 130 while (client && client->transientFor()) {
131 assert(client != client->transientFor()); 131 assert(client != client->transientFor());
132 client = client->transientFor(); 132 client = client->transientFor();
133 } 133 }
@@ -1317,12 +1317,6 @@ bool FluxboxWindow::focus() {
1317 screen().changeWorkspaceID(workspaceNumber()); 1317 screen().changeWorkspaceID(workspaceNumber());
1318 } 1318 }
1319 1319
1320 FluxboxWindow *cur = FocusControl::focusedFbWindow();
1321 WinClient *client = FocusControl::focusedWindow();
1322 if (cur && client && cur != this && cur->isFullscreen() &&
1323 getRootTransientFor(m_client) != getRootTransientFor(client))
1324 return false;
1325
1326 if (isIconic()) { 1320 if (isIconic()) {
1327 deiconify(); 1321 deiconify();
1328 m_focused = true; // signal to mapNotifyEvent to set focus when mapped 1322 m_focused = true; // signal to mapNotifyEvent to set focus when mapped
@@ -1893,7 +1887,7 @@ void FluxboxWindow::moveToLayer(int layernum, bool force) {
1893 if (!m_initialized) 1887 if (!m_initialized)
1894 m_layernum = layernum; 1888 m_layernum = layernum;
1895 1889
1896 if (m_layernum == layernum && !force) 1890 if (m_layernum == layernum && !force || !m_client)
1897 return; 1891 return;
1898 1892
1899 // get root window 1893 // get root window
@@ -1942,6 +1936,8 @@ void FluxboxWindow::setIconHidden(bool value) {
1942// window has actually RECEIVED focus (got a FocusIn event) 1936// window has actually RECEIVED focus (got a FocusIn event)
1943// so now we make it a focused frame etc 1937// so now we make it a focused frame etc
1944void FluxboxWindow::setFocusFlag(bool focus) { 1938void FluxboxWindow::setFocusFlag(bool focus) {
1939 if (!m_client) return;
1940
1945 bool was_focused = isFocused(); 1941 bool was_focused = isFocused();
1946 m_focused = focus; 1942 m_focused = focus;
1947#ifdef DEBUG 1943#ifdef DEBUG
@@ -1950,10 +1946,17 @@ void FluxboxWindow::setFocusFlag(bool focus) {
1950 1946
1951 installColormap(focus); 1947 installColormap(focus);
1952 1948
1949 if (fullscreen && !focus)
1950 moveToLayer(m_old_layernum);
1951 if (fullscreen && focus)
1952 moveToLayer(::Layer::ABOVE_DOCK);
1953
1953 if (focus != frame().focused()) 1954 if (focus != frame().focused())
1954 frame().setFocus(focus); 1955 frame().setFocus(focus);
1955 1956
1956 if (screen().doAutoRaise() && !screen().focusControl().isCycling()) { 1957 if (screen().focusControl().isCycling())
1958 tempRaise();
1959 else if (screen().doAutoRaise()) {
1957 if (m_focused) 1960 if (m_focused)
1958 m_timer.start(); 1961 m_timer.start();
1959 else 1962 else