aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2007-12-22 02:35:05 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2007-12-22 02:35:05 (GMT)
commit0906477984edbd9f6e62fed3800ea9a441919a58 (patch)
treeff45afc3bfc55814da023afea15e6d1a2be053aa /src
parentf6ee704a1d3429c6dedb03d84b4d70103cf8db15 (diff)
downloadfluxbox_paul-0906477984edbd9f6e62fed3800ea9a441919a58.zip
fluxbox_paul-0906477984edbd9f6e62fed3800ea9a441919a58.tar.bz2
leave fullscreen windows on top, even without the focus, as long as focused window is on another head
Diffstat (limited to 'src')
-rw-r--r--src/Window.cc35
-rw-r--r--src/Window.hh2
2 files changed, 32 insertions, 5 deletions
diff --git a/src/Window.cc b/src/Window.cc
index fed465e..4c1bf64 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1499,11 +1499,11 @@ void FluxboxWindow::setFullscreen(bool flag) {
1499 m_last_resize_x = frame().x(); 1499 m_last_resize_x = frame().x();
1500 m_last_resize_y = frame().y(); 1500 m_last_resize_y = frame().y();
1501 1501
1502 moveToLayer(::Layer::ABOVE_DOCK);
1503
1504 fullscreen = true; 1502 fullscreen = true;
1505 1503
1506 stateSig().notify(); 1504 setFullscreenLayer();
1505 if (!isFocused())
1506 screen().focusedWindowSig().attach(this);
1507 1507
1508 } else if (!flag && isFullscreen()) { 1508 } else if (!flag && isFullscreen()) {
1509 1509
@@ -1541,6 +1541,21 @@ void FluxboxWindow::setFullscreen(bool flag) {
1541 } 1541 }
1542} 1542}
1543 1543
1544void FluxboxWindow::setFullscreenLayer() {
1545
1546 FluxboxWindow *foc = FocusControl::focusedFbWindow();
1547 // if another window on the same head is focused, make sure we can see it
1548 if (isFocused() || !foc || &foc->screen() != &screen() ||
1549 getOnHead() != foc->getOnHead()) {
1550 moveToLayer(::Layer::ABOVE_DOCK);
1551 } else {
1552 moveToLayer(m_old_layernum);
1553 lower();
1554 }
1555 stateSig().notify();
1556
1557}
1558
1544/** 1559/**
1545 Maximize window both horizontal and vertical 1560 Maximize window both horizontal and vertical
1546*/ 1561*/
@@ -1899,10 +1914,15 @@ void FluxboxWindow::setFocusFlag(bool focus) {
1899 1914
1900 installColormap(focus); 1915 installColormap(focus);
1901 1916
1917 // if we're fullscreen and another window gains focus on the same head,
1918 // then we need to let the user see it
1902 if (fullscreen && !focus) 1919 if (fullscreen && !focus)
1903 moveToLayer(m_old_layernum); 1920 screen().focusedWindowSig().attach(this);
1904 if (fullscreen && focus) 1921
1922 if (fullscreen && focus) {
1905 moveToLayer(::Layer::ABOVE_DOCK); 1923 moveToLayer(::Layer::ABOVE_DOCK);
1924 screen().focusedWindowSig().detach(this);
1925 }
1906 1926
1907 if (focus != frame().focused()) 1927 if (focus != frame().focused())
1908 frame().setFocus(focus); 1928 frame().setFocus(focus);
@@ -2922,6 +2942,11 @@ void FluxboxWindow::update(FbTk::Subject *subj) {
2922 titleSig().notify(); 2942 titleSig().notify();
2923 } 2943 }
2924 2944
2945 } else if (subj && typeid(*subj) == typeid(BScreen::ScreenSubject)) {
2946 if (subj == &screen().focusedWindowSig()) {
2947 if (FocusControl::focusedFbWindow())
2948 setFullscreenLayer();
2949 }
2925 } 2950 }
2926} 2951}
2927 2952
diff --git a/src/Window.hh b/src/Window.hh
index 032ea07..e75b84c 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -547,6 +547,8 @@ private:
547 void associateClientWindow(bool use_attrs = false, int x = 0, int y = 0, unsigned int width = 1, unsigned int height = 1, int gravity = ForgetGravity, unsigned int client_bw = 0); 547 void associateClientWindow(bool use_attrs = false, int x = 0, int y = 0, unsigned int width = 1, unsigned int height = 1, int gravity = ForgetGravity, unsigned int client_bw = 0);
548 548
549 void setState(unsigned long stateval, bool setting_up); 549 void setState(unsigned long stateval, bool setting_up);
550 /// set the layer of a fullscreen window
551 void setFullscreenLayer();
550 552
551 // modifies left and top if snap is necessary 553 // modifies left and top if snap is necessary
552 void doSnapping(int &left, int &top); 554 void doSnapping(int &left, int &top);