aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2012-07-14 08:08:28 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2012-07-14 08:08:28 (GMT)
commita076bdcbdaef5d61370acd35e8e2870fb7ad9e09 (patch)
tree407162dc75cc242fa446a7dece77987aad0c81e8 /src
parent9a28a8bfec7606f19f373a27df33a89ba6f7de7c (diff)
parent2944cd0014cde6a219822f120fff9588225e8776 (diff)
downloadfluxbox-a076bdcbdaef5d61370acd35e8e2870fb7ad9e09.zip
fluxbox-a076bdcbdaef5d61370acd35e8e2870fb7ad9e09.tar.bz2
merge
Diffstat (limited to 'src')
-rw-r--r--src/ClientPattern.cc18
-rw-r--r--src/ClientPattern.hh2
-rw-r--r--src/FocusControl.cc2
-rw-r--r--src/Focusable.hh4
-rw-r--r--src/Window.cc21
-rw-r--r--src/Window.hh1
-rw-r--r--src/WindowState.hh8
7 files changed, 40 insertions, 16 deletions
diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc
index f49f7fd..f57513d 100644
--- a/src/ClientPattern.cc
+++ b/src/ClientPattern.cc
@@ -67,13 +67,17 @@ struct Name2WinProperty {
67 ClientPattern::WinProperty prop; 67 ClientPattern::WinProperty prop;
68}; 68};
69 69
70const Name2WinProperty name_2_winproperties[] = { // sorted for 'bsearch' 70// sorted alphabetically for 'bsearch'
71const Name2WinProperty name_2_winproperties[] = {
71 { "class", ClientPattern::CLASS }, 72 { "class", ClientPattern::CLASS },
72 { "focushidden", ClientPattern::FOCUSHIDDEN }, 73 { "focushidden", ClientPattern::FOCUSHIDDEN },
74 { "fullscreen", ClientPattern::FULLSCREEN },
73 { "head", ClientPattern::HEAD }, 75 { "head", ClientPattern::HEAD },
74 { "iconhidden", ClientPattern::ICONHIDDEN }, 76 { "iconhidden", ClientPattern::ICONHIDDEN },
75 { "layer", ClientPattern::LAYER }, 77 { "layer", ClientPattern::LAYER },
76 { "maximized", ClientPattern::MAXIMIZED }, 78 { "maximized", ClientPattern::MAXIMIZED },
79 { "maximizedhorizontal", ClientPattern::HORZMAX },
80 { "maximizedvertical", ClientPattern::VERTMAX },
77 { "minimized", ClientPattern::MINIMIZED }, 81 { "minimized", ClientPattern::MINIMIZED },
78 { "name", ClientPattern::NAME }, 82 { "name", ClientPattern::NAME },
79 { "role", ClientPattern::ROLE }, 83 { "role", ClientPattern::ROLE },
@@ -132,6 +136,9 @@ Prop2String property_2_strings[] = { // sorted by 'prop'
132 { ClientPattern::URGENT, "urgent" }, 136 { ClientPattern::URGENT, "urgent" },
133 { ClientPattern::SCREEN, "screen" }, 137 { ClientPattern::SCREEN, "screen" },
134 { ClientPattern::XPROP, "@" }, 138 { ClientPattern::XPROP, "@" },
139 { ClientPattern::FULLSCREEN, "fullscreen" },
140 { ClientPattern::VERTMAX, "maximizedvertical" },
141 { ClientPattern::HORZMAX, "maximizedhorizontal" },
135}; 142};
136 143
137 144
@@ -411,6 +418,15 @@ FbTk::FbString ClientPattern::getProperty(WinProperty prop, const Focusable &cli
411 case MINIMIZED: 418 case MINIMIZED:
412 result = (fbwin && fbwin->isIconic()) ? "yes" : "no"; 419 result = (fbwin && fbwin->isIconic()) ? "yes" : "no";
413 break; 420 break;
421 case FULLSCREEN:
422 result = (fbwin && fbwin->isFullscreen()) ? "yes" : "no";
423 break;
424 case VERTMAX:
425 result = (fbwin && fbwin->isMaximizedVert()) ? "yes" : "no";
426 break;
427 case HORZMAX:
428 result = (fbwin && fbwin->isMaximizedHorz()) ? "yes" : "no";
429 break;
414 case SHADED: 430 case SHADED:
415 result = (fbwin && fbwin->isShaded()) ? "yes" : "no"; 431 result = (fbwin && fbwin->isShaded()) ? "yes" : "no";
416 break; 432 break;
diff --git a/src/ClientPattern.hh b/src/ClientPattern.hh
index 315edb1..a5b7206 100644
--- a/src/ClientPattern.hh
+++ b/src/ClientPattern.hh
@@ -55,7 +55,7 @@ public:
55 TITLE = 0, CLASS, NAME, ROLE, TRANSIENT, 55 TITLE = 0, CLASS, NAME, ROLE, TRANSIENT,
56 MAXIMIZED, MINIMIZED, SHADED, STUCK, FOCUSHIDDEN, ICONHIDDEN, 56 MAXIMIZED, MINIMIZED, SHADED, STUCK, FOCUSHIDDEN, ICONHIDDEN,
57 WORKSPACE, WORKSPACENAME, HEAD, LAYER, URGENT, SCREEN, 57 WORKSPACE, WORKSPACENAME, HEAD, LAYER, URGENT, SCREEN,
58 XPROP 58 XPROP, FULLSCREEN, VERTMAX, HORZMAX
59 }; 59 };
60 60
61 /// Does this client match this pattern? 61 /// Does this client match this pattern?
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index 5bf113f..383de61 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -53,7 +53,7 @@ namespace {
53 53
54bool doSkipWindow(const Focusable &win, const ClientPattern *pat) { 54bool doSkipWindow(const Focusable &win, const ClientPattern *pat) {
55 const FluxboxWindow *fbwin = win.fbwindow(); 55 const FluxboxWindow *fbwin = win.fbwindow();
56 if (!fbwin || fbwin->isFocusHidden()) 56 if (!fbwin || fbwin->isFocusHidden() || fbwin->isModal())
57 return true; // skip if no fbwindow or if focushidden 57 return true; // skip if no fbwindow or if focushidden
58 if (pat && !pat->match(win)) 58 if (pat && !pat->match(win))
59 return true; // skip if it doesn't match the pattern 59 return true; // skip if it doesn't match the pattern
diff --git a/src/Focusable.hh b/src/Focusable.hh
index 679e00b..fd0705b 100644
--- a/src/Focusable.hh
+++ b/src/Focusable.hh
@@ -54,8 +54,10 @@ public:
54 54
55 /// @return true if the focusable has input focus 55 /// @return true if the focusable has input focus
56 virtual bool isFocused() const { return m_focused; } 56 virtual bool isFocused() const { return m_focused; }
57 /// @return return true if it can be focused 57 /// @return true if it can be focused
58 virtual bool acceptsFocus() const { return true; } 58 virtual bool acceptsFocus() const { return true; }
59 /// @return true if temporarily prevented from being focused
60 virtual bool isModal() const { return false; }
59 61
60 /// @return true if icon button should appear focused 62 /// @return true if icon button should appear focused
61 bool getAttentionState() const { return m_attention_state; } 63 bool getAttentionState() const { return m_attention_state; }
diff --git a/src/Window.cc b/src/Window.cc
index f5a2fe2..747c909 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -3306,6 +3306,10 @@ bool FluxboxWindow::acceptsFocus() const {
3306 return (m_client ? m_client->acceptsFocus() : false); 3306 return (m_client ? m_client->acceptsFocus() : false);
3307} 3307}
3308 3308
3309bool FluxboxWindow::isModal() const {
3310 return (m_client ? m_client->isModal() : true);
3311}
3312
3309const FbTk::PixmapWithMask &FluxboxWindow::icon() const { 3313const FbTk::PixmapWithMask &FluxboxWindow::icon() const {
3310 return (m_client ? m_client->icon() : m_icon); 3314 return (m_client ? m_client->icon() : m_icon);
3311} 3315}
@@ -3609,15 +3613,16 @@ void FluxboxWindow::updateButtons() {
3609 } 3613 }
3610 break; 3614 break;
3611 case WinButton::MENUICON: 3615 case WinButton::MENUICON:
3612 winbtn = new WinButton(*this, m_button_theme, 3616 if (m_state.deco_mask & WindowState::DECORM_MENU) {
3613 screen().pressedWinButtonTheme(), 3617 winbtn = new WinButton(*this, m_button_theme,
3614 dir[i], 3618 screen().pressedWinButtonTheme(),
3615 frame().titlebar(), 3619 dir[i],
3616 0, 0, 10, 10); 3620 frame().titlebar(),
3617 winbtn->join(titleSig(), 3621 0, 0, 10, 10);
3622 winbtn->join(titleSig(),
3618 FbTk::MemFunIgnoreArgs(*winbtn, &WinButton::updateAll)); 3623 FbTk::MemFunIgnoreArgs(*winbtn, &WinButton::updateAll));
3619 3624 winbtn->setOnClick(show_menu_cmd);
3620 winbtn->setOnClick(show_menu_cmd); 3625 }
3621 break; 3626 break;
3622 } 3627 }
3623 3628
diff --git a/src/Window.hh b/src/Window.hh
index 0d2cadd..8c97c7b 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -414,6 +414,7 @@ public:
414 FbTk::FbWindow &parent() { return m_parent; } 414 FbTk::FbWindow &parent() { return m_parent; }
415 415
416 bool acceptsFocus() const; 416 bool acceptsFocus() const;
417 bool isModal() const;
417 const FbTk::PixmapWithMask &icon() const; 418 const FbTk::PixmapWithMask &icon() const;
418 const FbTk::BiDiString &title() const; 419 const FbTk::BiDiString &title() const;
419 const FbTk::FbString &getWMClassName() const; 420 const FbTk::FbString &getWMClassName() const;
diff --git a/src/WindowState.hh b/src/WindowState.hh
index 58664fa..6b45a44 100644
--- a/src/WindowState.hh
+++ b/src/WindowState.hh
@@ -90,10 +90,10 @@ public:
90 enum Decoration { 90 enum Decoration {
91 DECOR_NONE = 0, 91 DECOR_NONE = 0,
92 DECOR_NORMAL = DECORM_LAST - 1, 92 DECOR_NORMAL = DECORM_LAST - 1,
93 DECOR_TINY = DECORM_TITLEBAR|DECORM_ICONIFY|DECORM_MENU|DECORM_TAB, 93 DECOR_TINY = DECORM_TITLEBAR|DECORM_ICONIFY,
94 DECOR_TOOL = DECORM_TITLEBAR|DECORM_MENU, 94 DECOR_TOOL = DECORM_TITLEBAR,
95 DECOR_BORDER = DECORM_BORDER|DECORM_MENU, 95 DECOR_BORDER = DECORM_BORDER,
96 DECOR_TAB = DECORM_BORDER|DECORM_MENU|DECORM_TAB 96 DECOR_TAB = DECORM_BORDER|DECORM_TAB
97 }; 97 };
98 98
99 enum WindowType { 99 enum WindowType {