aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-10-14 18:05:31 (GMT)
committermarkt <markt>2007-10-14 18:05:31 (GMT)
commit7e4f8a38531642cc9cb6cba31499d549f4c5f8a0 (patch)
treecd06e7c0330aff145744a8284bf5ff8ad4f0bbe1
parent79cd21ce0fe56f4b38a96ecccc969f740b801cc8 (diff)
downloadfluxbox_pavel-7e4f8a38531642cc9cb6cba31499d549f4c5f8a0.zip
fluxbox_pavel-7e4f8a38531642cc9cb6cba31499d549f4c5f8a0.tar.bz2
add support for transient windows in client patterns, and merge a few more changes from pre-devel
-rw-r--r--ChangeLog3
-rw-r--r--data/init.in2
-rw-r--r--data/keys3
-rw-r--r--doc/asciidoc/fluxbox.txt32
-rw-r--r--src/ClientPattern.cc14
-rw-r--r--src/ClientPattern.hh4
-rw-r--r--src/Focusable.hh5
-rw-r--r--src/Remember.cc15
-rw-r--r--src/Window.cc4
-rw-r--r--src/Window.hh1
10 files changed, 46 insertions, 37 deletions
diff --git a/ChangeLog b/ChangeLog
index f756911..5a02886 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.0.1: 2Changes for 1.0.1:
3*07/10/14: 3*07/10/14:
4 * Added support for transient windows in window patterns, e.g.
5 (transient=yes|no), defaulting to "no" for the apps file (Mark)
6 Remember.cc ClientPattern.cc/hh Focusable.hh Window.cc/hh
4 * Bugfix for SendToPrevWorkspace/TakeToPrevWorkspace (Mathias) 7 * Bugfix for SendToPrevWorkspace/TakeToPrevWorkspace (Mathias)
5 CurrentWindowCmd.cc/hh 8 CurrentWindowCmd.cc/hh
6*07/10/13: 9*07/10/13:
diff --git a/data/init.in b/data/init.in
index 43ab4ae..5ad9aa3 100644
--- a/data/init.in
+++ b/data/init.in
@@ -31,4 +31,4 @@ session.colorsPerChannel: 4
31session.doubleClickInterval: 250 31session.doubleClickInterval: 250
32session.cacheMax: 200 32session.cacheMax: 200
33session.imageDither: True 33session.imageDither: True
34session.configVersion: 1 34session.configVersion: 3
diff --git a/data/keys b/data/keys
index d76b18f..603e15c 100644
--- a/data/keys
+++ b/data/keys
@@ -4,6 +4,9 @@ OnDesktop Mouse3 :RootMenu
4OnDesktop Mouse4 :NextWorkspace 4OnDesktop Mouse4 :NextWorkspace
5OnDesktop Mouse5 :PrevWorkspace 5OnDesktop Mouse5 :PrevWorkspace
6 6
7OnToolbar Mouse4 :NextWorkspace
8OnToolbar Mouse5 :PrevWorkspace
9
7Mod1 Tab :NextWindow 10Mod1 Tab :NextWindow
8Mod1 Shift Tab :PrevWindow 11Mod1 Shift Tab :PrevWindow
9Mod1 F1 :Workspace 1 12Mod1 F1 :Workspace 1
diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
index 9126758..0c136a0 100644
--- a/doc/asciidoc/fluxbox.txt
+++ b/doc/asciidoc/fluxbox.txt
@@ -706,20 +706,15 @@ session.screen0.toolbar.autoHide: <boolean>
706 used actively by the user, or they remain visible at all times. Default: 706 used actively by the user, or they remain visible at all times. Default:
707 False 707 False
708 708
709session.screen0.desktopwheeling: <boolean>
710 This sets the ability to utilize the user's scroll wheel to change the
711 current workspace. Default: True
712
713session.screen0.windowScrollAction: shade|nexttab 709session.screen0.windowScrollAction: shade|nexttab
714 This allows you to execute a command by scrolling on the titlebar of a 710 This allows you to execute a command by scrolling on the titlebar of a
715 window. For `shade', scrolling down will shade the window, and scrolling 711 window. For `shade', scrolling down will shade the window, and scrolling
716 up will unshade it. For `nexttab', scrolling down will focus the next tab, 712 up will unshade it. For `nexttab', scrolling down will focus the next tab,
717 and scrolling up will focus the previous one. Default: <blank> 713 and scrolling up will focus the previous one. Default: <blank>
718 714
719session.screen0.reversewheeling: <boolean>
720session.screen0.windowScrollReverse: <boolean> 715session.screen0.windowScrollReverse: <boolean>
721 These switch the roles of scrolling up and scrolling down for the previous 716 This switches the role of scrolling up and scrolling down for the previous
722 two sets of resources. Default: False 717 resource. Default: False
723 718
724session.screen0.slit.layer: <layer> 719session.screen0.slit.layer: <layer>
725session.screen0.toolbar.layer: <layer> 720session.screen0.toolbar.layer: <layer>
@@ -802,12 +797,6 @@ session.screen0.iconbar.iconTextPadding: <integer>
802 This specifies the space between the window title and the edge of the 797 This specifies the space between the window title and the edge of the
803 button. Default: 10 798 button. Default: 10
804 799
805session.screen0.iconbar.wheelMode: Screen|On|Off
806 This defines the behavior for scrolling on the iconbar. `Screen' uses the
807 value set in session.screen0.desktopWheeling . `On' means scrolling on the
808 iconbar will change the current workspace. `Off' means scrolling on the
809 iconbar will do nothing. Default: Screen
810
811session.screen0.iconbar.alignment: <position> 800session.screen0.iconbar.alignment: <position>
812 This value should be changed in the Iconbar Mode menu. Default: 801 This value should be changed in the Iconbar Mode menu. Default:
813 Relative 802 Relative
@@ -847,16 +836,17 @@ session.screen0.tab.placement: <placement>
847session.screen0.tab.width: <integer> 836session.screen0.tab.width: <integer>
848 This specifies the width of external tabs in pixels. Default: 64 837 This specifies the width of external tabs in pixels. Default: 64
849 838
850session.screen0.followModel: <model>
851session.screen0.userFollowModel: <model> 839session.screen0.userFollowModel: <model>
852 This specifies the behavior when a window on another workspace becomes the 840 This specifies the behavior when a window on another workspace becomes the
853 active window. The former is used when an application asks to focus the 841 active window. `Ignore' does nothing. `Follow' moves to the window's
854 window, and the latter is used when the window is activated due to user 842 workspace. `Current' moves the window to the current workspace.
855 actions, such as clicking in the iconbar, menu, or a pager. `Ignore' does 843 `SemiFollow' acts like `Current' for minimized windows and like `Follow'
856 nothing. `Follow' moves to the window's workspace. `Current' moves the 844 otherwise. Default: Follow
857 window to the current workspace. `SemiFollow' acts like `Current' for 845
858 iconified windows and like `Follow' otherwise. Defaults: Ignore and 846session.screen0.followModel: <model>
859 Follow, respectively. 847 This specifies the behavior when a window on another workspace requests to
848 be focused. `Ignore' does nothing, and `Follow' uses the setting in
849 session.screen0.userFollowModel. Default: Ignore
860 850
861session.screen0.resizeMode: Bottom|Quadrant|Center 851session.screen0.resizeMode: Bottom|Quadrant|Center
862 Setting this resource to `Quadrant' makes resizing by using the modkey 852 Setting this resource to `Quadrant' makes resizing by using the modkey
diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc
index 9324bee..538b708 100644
--- a/src/ClientPattern.cc
+++ b/src/ClientPattern.cc
@@ -60,7 +60,7 @@ ClientPattern::ClientPattern():
60 m_nummatches(0) {} 60 m_nummatches(0) {}
61 61
62// parse the given pattern (to end of line) 62// parse the given pattern (to end of line)
63ClientPattern::ClientPattern(const char *str): 63ClientPattern::ClientPattern(const char *str, bool default_no_transient):
64 m_matchlimit(0), 64 m_matchlimit(0),
65 m_nummatches(0) 65 m_nummatches(0)
66{ 66{
@@ -107,6 +107,9 @@ ClientPattern::ClientPattern(const char *str):
107 prop = TITLE; 107 prop = TITLE;
108 } else if (strcasecmp(memstr.c_str(), "role") == 0) { 108 } else if (strcasecmp(memstr.c_str(), "role") == 0) {
109 prop = ROLE; 109 prop = ROLE;
110 } else if (strcasecmp(memstr.c_str(), "transient") == 0) {
111 prop = TRANSIENT;
112 default_no_transient = false;
110 } else if (strcasecmp(memstr.c_str(), "maximized") == 0) { 113 } else if (strcasecmp(memstr.c_str(), "maximized") == 0) {
111 prop = MAXIMIZED; 114 prop = MAXIMIZED;
112 } else if (strcasecmp(memstr.c_str(), "minimized") == 0) { 115 } else if (strcasecmp(memstr.c_str(), "minimized") == 0) {
@@ -138,6 +141,9 @@ ClientPattern::ClientPattern(const char *str):
138 had_error = true; 141 had_error = true;
139 } 142 }
140 143
144 if (default_no_transient)
145 had_error = !addTerm("no", TRANSIENT);
146
141 if (!had_error) { 147 if (!had_error) {
142 // otherwise, we check for a number 148 // otherwise, we check for a number
143 string number; 149 string number;
@@ -201,6 +207,9 @@ string ClientPattern::toString() const {
201 case ROLE: 207 case ROLE:
202 pat.append("role="); 208 pat.append("role=");
203 break; 209 break;
210 case TRANSIENT:
211 pat.append("transient=");
212 break;
204 case MAXIMIZED: 213 case MAXIMIZED:
205 pat.append("maximized="); 214 pat.append("maximized=");
206 break; 215 break;
@@ -307,6 +316,9 @@ string ClientPattern::getProperty(WinProperty prop,
307 case ROLE: 316 case ROLE:
308 return client.getWMRole(); 317 return client.getWMRole();
309 break; 318 break;
319 case TRANSIENT:
320 return client.isTransient() ? "yes" : "no";
321 break;
310 case MAXIMIZED: 322 case MAXIMIZED:
311 return (fbwin && fbwin->isMaximized()) ? "yes" : "no"; 323 return (fbwin && fbwin->isMaximized()) ? "yes" : "no";
312 break; 324 break;
diff --git a/src/ClientPattern.hh b/src/ClientPattern.hh
index 4a3cd0b..e5f4944 100644
--- a/src/ClientPattern.hh
+++ b/src/ClientPattern.hh
@@ -46,7 +46,7 @@ public:
46 * apps file. the bool value returns the character at which 46 * apps file. the bool value returns the character at which
47 * there was a parse problem, or -1. 47 * there was a parse problem, or -1.
48 */ 48 */
49 explicit ClientPattern(const char * str); 49 explicit ClientPattern(const char * str, bool default_no_transient = false);
50 50
51 ~ClientPattern(); 51 ~ClientPattern();
52 52
@@ -54,7 +54,7 @@ public:
54 std::string toString() const; 54 std::string toString() const;
55 55
56 enum WinProperty { 56 enum WinProperty {
57 TITLE, CLASS, NAME, ROLE, 57 TITLE, CLASS, NAME, ROLE, TRANSIENT,
58 MAXIMIZED, MINIMIZED, SHADED, STUCK, FOCUSHIDDEN, ICONHIDDEN, 58 MAXIMIZED, MINIMIZED, SHADED, STUCK, FOCUSHIDDEN, ICONHIDDEN,
59 WORKSPACE, HEAD, LAYER 59 WORKSPACE, HEAD, LAYER
60 }; 60 };
diff --git a/src/Focusable.hh b/src/Focusable.hh
index e02e0d7..cd2ad49 100644
--- a/src/Focusable.hh
+++ b/src/Focusable.hh
@@ -84,9 +84,12 @@ public:
84 virtual const std::string &getWMClassClass() const { return m_class_name; } 84 virtual const std::string &getWMClassClass() const { return m_class_name; }
85 /// @return WM_CLASS name string (for pattern matching) 85 /// @return WM_CLASS name string (for pattern matching)
86 virtual const std::string &getWMClassName() const { return m_instance_name; } 86 virtual const std::string &getWMClassName() const { return m_instance_name; }
87 /// @return wm role string ( for pattern matching) 87 /// @return wm role string (for pattern matching)
88 virtual std::string getWMRole() const { return "Focusable"; } 88 virtual std::string getWMRole() const { return "Focusable"; }
89 89
90 /// @return whether this window is a transient (for pattern matching)
91 virtual bool isTransient() const { return false; }
92
90 // so we can make nice buttons, menu entries, etc. 93 // so we can make nice buttons, menu entries, etc.
91 /// @return icon pixmap of the focusable 94 /// @return icon pixmap of the focusable
92 virtual const FbTk::PixmapWithMask &icon() const { return m_icon; } 95 virtual const FbTk::PixmapWithMask &icon() const { return m_icon; }
diff --git a/src/Remember.cc b/src/Remember.cc
index fbb4a2e..d8f1d83 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -339,6 +339,7 @@ Application * Remember::add(WinClient &winclient) {
339 p->addTerm(win_class, ClientPattern::CLASS); 339 p->addTerm(win_class, ClientPattern::CLASS);
340 if (!win_role.empty()) 340 if (!win_role.empty())
341 p->addTerm(win_role, ClientPattern::ROLE); 341 p->addTerm(win_role, ClientPattern::ROLE);
342 p->addTerm(winclient.isTransient() ? "yes" : "no", ClientPattern::TRANSIENT);
342 m_clients[&winclient] = app; 343 m_clients[&winclient] = app;
343 p->addMatch(); 344 p->addMatch();
344 m_pats->push_back(make_pair(p, app)); 345 m_pats->push_back(make_pair(p, app));
@@ -594,7 +595,7 @@ void Remember::reconfigure() {
594 '[', ']'); 595 '[', ']');
595 596
596 if (pos > 0 && strcasecmp(key.c_str(), "app") == 0) { 597 if (pos > 0 && strcasecmp(key.c_str(), "app") == 0) {
597 ClientPattern *pat = new ClientPattern(line.c_str() + pos); 598 ClientPattern *pat = new ClientPattern(line.c_str() + pos, true);
598 if (!in_group) { 599 if (!in_group) {
599 if ((err = pat->error()) == 0) { 600 if ((err = pat->error()) == 0) {
600 Application *app = findMatchingPatterns(pat, old_pats, false); 601 Application *app = findMatchingPatterns(pat, old_pats, false);
@@ -620,7 +621,7 @@ void Remember::reconfigure() {
620 } else if (pos > 0 && strcasecmp(key.c_str(), "group") == 0) { 621 } else if (pos > 0 && strcasecmp(key.c_str(), "group") == 0) {
621 in_group = true; 622 in_group = true;
622 if (line.find('(') != string::npos) 623 if (line.find('(') != string::npos)
623 pat = new ClientPattern(line.c_str() + pos); 624 pat = new ClientPattern(line.c_str() + pos, true);
624 } else if (in_group) { 625 } else if (in_group) {
625 // otherwise assume that it is the start of the attributes 626 // otherwise assume that it is the start of the attributes
626 Application *app = 0; 627 Application *app = 0;
@@ -1020,13 +1021,6 @@ void Remember::forgetAttrib(WinClient &winclient, Attribute attrib) {
1020 1021
1021void Remember::setupFrame(FluxboxWindow &win) { 1022void Remember::setupFrame(FluxboxWindow &win) {
1022 WinClient &winclient = win.winClient(); 1023 WinClient &winclient = win.winClient();
1023 // we don't touch the window if it is a transient
1024 // of something else
1025
1026
1027 if (winclient.transientFor())
1028 return;
1029
1030 Application *app = find(winclient); 1024 Application *app = find(winclient);
1031 if (app == 0) 1025 if (app == 0)
1032 return; // nothing to do 1026 return; // nothing to do
@@ -1123,8 +1117,7 @@ void Remember::setupFrame(FluxboxWindow &win) {
1123void Remember::setupClient(WinClient &winclient) { 1117void Remember::setupClient(WinClient &winclient) {
1124 1118
1125 // leave windows alone on restart 1119 // leave windows alone on restart
1126 // don't apply settings to transient windows 1120 if (winclient.screen().isRestart())
1127 if (winclient.screen().isRestart() || winclient.transientFor())
1128 return; 1121 return;
1129 1122
1130 Application *app = find(winclient); 1123 Application *app = find(winclient);
diff --git a/src/Window.cc b/src/Window.cc
index a5cf6fd..27bc7ec 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -3636,6 +3636,10 @@ std::string FluxboxWindow::getWMRole() const {
3636 return (m_client ? m_client->getWMRole() : "FluxboxWindow"); 3636 return (m_client ? m_client->getWMRole() : "FluxboxWindow");
3637} 3637}
3638 3638
3639bool FluxboxWindow::isTransient() const {
3640 return (m_client && m_client->isTransient());
3641}
3642
3639int FluxboxWindow::normalX() const { 3643int FluxboxWindow::normalX() const {
3640 if (maximized & MAX_HORZ) 3644 if (maximized & MAX_HORZ)
3641 return m_old_pos_x; 3645 return m_old_pos_x;
diff --git a/src/Window.hh b/src/Window.hh
index d001284..3a87463 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -435,6 +435,7 @@ public:
435 const std::string &getWMClassName() const; 435 const std::string &getWMClassName() const;
436 const std::string &getWMClassClass() const; 436 const std::string &getWMClassClass() const;
437 std::string getWMRole() const; 437 std::string getWMRole() const;
438 bool isTransient() const;
438 439
439 inline int x() const { return frame().x(); } 440 inline int x() const { return frame().x(); }
440 inline int y() const { return frame().y(); } 441 inline int y() const { return frame().y(); }