diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-10-05 02:30:19 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-10-05 02:30:19 (GMT) |
commit | 86a072e7fdbaa92744eb78ecc2e39e462477fd2e (patch) | |
tree | abcd180f8255084061dd22b37dc4434387f1ff9d /src | |
parent | e1eb5e225b316a55aaab34547c20ad8c67168c3e (diff) | |
download | fluxbox_lack-86a072e7fdbaa92744eb78ecc2e39e462477fd2e.zip fluxbox_lack-86a072e7fdbaa92744eb78ecc2e39e462477fd2e.tar.bz2 |
remove follow models
Diffstat (limited to 'src')
-rw-r--r-- | src/Screen.cc | 2 | ||||
-rw-r--r-- | src/Screen.hh | 12 | ||||
-rw-r--r-- | src/ScreenResources.cc | 132 | ||||
-rw-r--r-- | src/Window.cc | 15 |
4 files changed, 3 insertions, 158 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index 2c54d5d..18138c9 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -299,8 +299,6 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm, | |||
299 | tab_placement(rm, FbWinFrame::TOPLEFT, scrname+".tab.placement", altscrname+".Tab.Placement"), | 299 | tab_placement(rm, FbWinFrame::TOPLEFT, scrname+".tab.placement", altscrname+".Tab.Placement"), |
300 | windowmenufile(rm, Fluxbox::instance()->getDefaultDataFilename("windowmenu"), scrname+".windowMenu", altscrname+".WindowMenu"), | 300 | windowmenufile(rm, Fluxbox::instance()->getDefaultDataFilename("windowmenu"), scrname+".windowMenu", altscrname+".WindowMenu"), |
301 | typing_delay(rm, 0, scrname+".noFocusWhileTypingDelay", altscrname+".NoFocusWhileTypingDelay"), | 301 | typing_delay(rm, 0, scrname+".noFocusWhileTypingDelay", altscrname+".NoFocusWhileTypingDelay"), |
302 | follow_model(rm, SEMIFOLLOW_ACTIVE_WINDOW, scrname+".followModel", altscrname+".followModel"), | ||
303 | user_follow_model(rm, SEMIFOLLOW_ACTIVE_WINDOW, scrname+".userFollowModel", altscrname+".UserFollowModel"), | ||
304 | workspaces(rm, 4, scrname+".workspaces", altscrname+".Workspaces"), | 302 | workspaces(rm, 4, scrname+".workspaces", altscrname+".Workspaces"), |
305 | edge_snap_threshold(rm, 10, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"), | 303 | edge_snap_threshold(rm, 10, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"), |
306 | focused_alpha(rm, 255, scrname+".window.focus.alpha", altscrname+".Window.Focus.Alpha"), | 304 | focused_alpha(rm, 255, scrname+".window.focus.alpha", altscrname+".Window.Focus.Alpha"), |
diff --git a/src/Screen.hh b/src/Screen.hh index c81098b..9511e3f 100644 --- a/src/Screen.hh +++ b/src/Screen.hh | |||
@@ -85,15 +85,6 @@ class Subject; | |||
85 | class BScreen: public FbTk::EventHandler, public FbTk::Observer, | 85 | class BScreen: public FbTk::EventHandler, public FbTk::Observer, |
86 | private FbTk::NotCopyable { | 86 | private FbTk::NotCopyable { |
87 | public: | 87 | public: |
88 | /// a window becomes active / focussed on a different workspace | ||
89 | enum FollowModel { | ||
90 | IGNORE_OTHER_WORKSPACES = 0, ///< who cares? | ||
91 | FOLLOW_ACTIVE_WINDOW, ///< go to that workspace | ||
92 | SEMIFOLLOW_ACTIVE_WINDOW, ///< fetch iconified windows, else follow | ||
93 | FETCH_ACTIVE_WINDOW ///< put that window to the current workspace | ||
94 | }; | ||
95 | |||
96 | |||
97 | typedef std::list<FluxboxWindow *> Icons; | 88 | typedef std::list<FluxboxWindow *> Icons; |
98 | 89 | ||
99 | typedef std::vector<Workspace *> Workspaces; | 90 | typedef std::vector<Workspace *> Workspaces; |
@@ -135,8 +126,6 @@ public: | |||
135 | FbWinFrame::TabPlacement getTabPlacement() const { return *resource.tab_placement; } | 126 | FbWinFrame::TabPlacement getTabPlacement() const { return *resource.tab_placement; } |
136 | 127 | ||
137 | unsigned int noFocusWhileTypingDelay() const { return *resource.typing_delay; } | 128 | unsigned int noFocusWhileTypingDelay() const { return *resource.typing_delay; } |
138 | FollowModel getFollowModel() const { return *resource.follow_model; } | ||
139 | FollowModel getUserFollowModel() const { return *resource.user_follow_model; } | ||
140 | const bool allowRemoteActions() const { return *resource.allow_remote_actions; } | 129 | const bool allowRemoteActions() const { return *resource.allow_remote_actions; } |
141 | const bool clientMenuUsePixmap() const { return *resource.clientmenu_use_pixmap; } | 130 | const bool clientMenuUsePixmap() const { return *resource.clientmenu_use_pixmap; } |
142 | const bool getDefaultInternalTabs() const { return *resource.default_internal_tabs; } | 131 | const bool getDefaultInternalTabs() const { return *resource.default_internal_tabs; } |
@@ -555,7 +544,6 @@ private: | |||
555 | FbTk::Resource<FbWinFrame::TabPlacement> tab_placement; | 544 | FbTk::Resource<FbWinFrame::TabPlacement> tab_placement; |
556 | FbTk::Resource<std::string> windowmenufile; | 545 | FbTk::Resource<std::string> windowmenufile; |
557 | FbTk::Resource<unsigned int> typing_delay; | 546 | FbTk::Resource<unsigned int> typing_delay; |
558 | FbTk::Resource<FollowModel> follow_model, user_follow_model; | ||
559 | FbTk::Resource<int> workspaces, edge_snap_threshold, focused_alpha, | 547 | FbTk::Resource<int> workspaces, edge_snap_threshold, focused_alpha, |
560 | unfocused_alpha, menu_alpha, menu_delay, menu_delay_close, | 548 | unfocused_alpha, menu_alpha, menu_delay, menu_delay_close, |
561 | tab_width, tooltip_delay; | 549 | tab_width, tooltip_delay; |
diff --git a/src/ScreenResources.cc b/src/ScreenResources.cc index 2d2ddb6..159ecaa 100644 --- a/src/ScreenResources.cc +++ b/src/ScreenResources.cc | |||
@@ -52,136 +52,4 @@ void FbTk::Resource<FbTk::MenuTheme::MenuMode>::setFromString(const char *str) { | |||
52 | else | 52 | else |
53 | setDefaultValue(); | 53 | setDefaultValue(); |
54 | } | 54 | } |
55 | |||
56 | template<> | ||
57 | string FbTk::Resource<BScreen::FollowModel>::getString() const { | ||
58 | switch (m_value) { | ||
59 | case BScreen::FOLLOW_ACTIVE_WINDOW: | ||
60 | default: | ||
61 | return string("Follow"); | ||
62 | break; | ||
63 | case BScreen::FETCH_ACTIVE_WINDOW: | ||
64 | return string("Current"); | ||
65 | break; | ||
66 | case BScreen::SEMIFOLLOW_ACTIVE_WINDOW: | ||
67 | return string("SemiFollow"); | ||
68 | break; | ||
69 | case BScreen::IGNORE_OTHER_WORKSPACES: | ||
70 | return string("Ignore"); | ||
71 | break; | ||
72 | } | ||
73 | |||
74 | } | ||
75 | |||
76 | template<> | ||
77 | void FbTk::Resource<BScreen::FollowModel>:: | ||
78 | setFromString(char const *strval) { | ||
79 | if (strcasecmp(strval, "Follow") == 0) | ||
80 | m_value = BScreen::FOLLOW_ACTIVE_WINDOW; | ||
81 | else if (strcasecmp(strval, "Current") == 0 || | ||
82 | strcasecmp(strval, "CurrentWorkspace") == 0 || | ||
83 | strcasecmp(strval, "Fetch") == 0) | ||
84 | m_value = BScreen::FETCH_ACTIVE_WINDOW; | ||
85 | else if (strcasecmp(strval, "SemiFollow") == 0) | ||
86 | m_value = BScreen::SEMIFOLLOW_ACTIVE_WINDOW; | ||
87 | else if (strcasecmp(strval, "Ignore") == 0) | ||
88 | m_value = BScreen::IGNORE_OTHER_WORKSPACES; | ||
89 | else | ||
90 | setDefaultValue(); | ||
91 | } | ||
92 | |||
93 | template<> | ||
94 | string FbTk::Resource<FbTk::GContext::LineStyle>::getString() const { | ||
95 | switch(m_value) { | ||
96 | case FbTk::GContext::LINESOLID: | ||
97 | return "LineSolid"; | ||
98 | break; | ||
99 | case FbTk::GContext::LINEONOFFDASH: | ||
100 | return "LineOnOffDash"; | ||
101 | break; | ||
102 | case FbTk::GContext::LINEDOUBLEDASH: | ||
103 | return "LineDoubleDash"; | ||
104 | break; | ||
105 | }; | ||
106 | return "LineSolid"; | ||
107 | } | ||
108 | |||
109 | template<> | ||
110 | void FbTk::Resource<FbTk::GContext::LineStyle> | ||
111 | ::setFromString(char const *strval) { | ||
112 | |||
113 | if (strcasecmp(strval, "LineSolid") == 0 ) | ||
114 | m_value = FbTk::GContext::LINESOLID; | ||
115 | else if (strcasecmp(strval, "LineOnOffDash") == 0 ) | ||
116 | m_value = FbTk::GContext::LINEONOFFDASH; | ||
117 | else if (strcasecmp(strval, "LineDoubleDash") == 0) | ||
118 | m_value = FbTk::GContext::LINEDOUBLEDASH; | ||
119 | else | ||
120 | setDefaultValue(); | ||
121 | } | ||
122 | |||
123 | template<> | ||
124 | string FbTk::Resource<FbTk::GContext::JoinStyle>::getString() const { | ||
125 | switch(m_value) { | ||
126 | case FbTk::GContext::JOINMITER: | ||
127 | return "JoinMiter"; | ||
128 | break; | ||
129 | case FbTk::GContext::JOINBEVEL: | ||
130 | return "JoinBevel"; | ||
131 | break; | ||
132 | case FbTk::GContext::JOINROUND: | ||
133 | return "JoinRound"; | ||
134 | break; | ||
135 | }; | ||
136 | return "JoinMiter"; | ||
137 | } | ||
138 | |||
139 | template<> | ||
140 | void FbTk::Resource<FbTk::GContext::JoinStyle> | ||
141 | ::setFromString(char const *strval) { | ||
142 | |||
143 | if (strcasecmp(strval, "JoinRound") == 0 ) | ||
144 | m_value = FbTk::GContext::JOINROUND; | ||
145 | else if (strcasecmp(strval, "JoinMiter") == 0 ) | ||
146 | m_value = FbTk::GContext::JOINMITER; | ||
147 | else if (strcasecmp(strval, "JoinBevel") == 0) | ||
148 | m_value = FbTk::GContext::JOINBEVEL; | ||
149 | else | ||
150 | setDefaultValue(); | ||
151 | } | ||
152 | |||
153 | template<> | ||
154 | string FbTk::Resource<FbTk::GContext::CapStyle>::getString() const { | ||
155 | switch(m_value) { | ||
156 | case FbTk::GContext::CAPNOTLAST: | ||
157 | return "CapNotLast"; | ||
158 | break; | ||
159 | case FbTk::GContext::CAPBUTT: | ||
160 | return "CapButt"; | ||
161 | break; | ||
162 | case FbTk::GContext::CAPROUND: | ||
163 | return "CapRound"; | ||
164 | break; | ||
165 | case FbTk::GContext::CAPPROJECTING: | ||
166 | return "CapProjecting"; | ||
167 | break; | ||
168 | }; | ||
169 | return "CapNotLast"; | ||
170 | } | ||
171 | |||
172 | template<> | ||
173 | void FbTk::Resource<FbTk::GContext::CapStyle> | ||
174 | ::setFromString(char const *strval) { | ||
175 | |||
176 | if (strcasecmp(strval, "CapNotLast") == 0 ) | ||
177 | m_value = FbTk::GContext::CAPNOTLAST; | ||
178 | else if (strcasecmp(strval, "CapProjecting") == 0 ) | ||
179 | m_value = FbTk::GContext::CAPPROJECTING; | ||
180 | else if (strcasecmp(strval, "CapRound") == 0) | ||
181 | m_value = FbTk::GContext::CAPROUND; | ||
182 | else if (strcasecmp(strval, "CapButt" ) == 0) | ||
183 | m_value = FbTk::GContext::CAPBUTT; | ||
184 | else | ||
185 | setDefaultValue(); | ||
186 | } | ||
187 | } // end namespace FbTk | 55 | } // end namespace FbTk |
diff --git a/src/Window.cc b/src/Window.cc index 305f7f3..da1809d 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -1273,13 +1273,8 @@ bool FluxboxWindow::focus() { | |||
1273 | 1273 | ||
1274 | if (screen().currentWorkspaceID() != workspaceNumber() && !isStuck()) { | 1274 | if (screen().currentWorkspaceID() != workspaceNumber() && !isStuck()) { |
1275 | 1275 | ||
1276 | BScreen::FollowModel model = screen().getUserFollowModel(); | 1276 | // fetch the window to the current workspace if minimized |
1277 | if (model == BScreen::IGNORE_OTHER_WORKSPACES) | 1277 | if (isIconic()) |
1278 | return false; | ||
1279 | |||
1280 | // fetch the window to the current workspace | ||
1281 | if (model == BScreen::FETCH_ACTIVE_WINDOW || | ||
1282 | (isIconic() && model == BScreen::SEMIFOLLOW_ACTIVE_WINDOW)) | ||
1283 | screen().sendToWorkspace(screen().currentWorkspaceID(), this, false); | 1278 | screen().sendToWorkspace(screen().currentWorkspaceID(), this, false); |
1284 | // warp to the workspace of the window | 1279 | // warp to the workspace of the window |
1285 | else | 1280 | else |
@@ -2041,14 +2036,10 @@ bool FluxboxWindow::focusRequestFromClient(WinClient &from) { | |||
2041 | return false; | 2036 | return false; |
2042 | 2037 | ||
2043 | bool ret = true; | 2038 | bool ret = true; |
2044 | // check what to do if window is on another workspace | ||
2045 | if (screen().currentWorkspaceID() != workspaceNumber() && !isStuck() && | ||
2046 | screen().getFollowModel() == BScreen::IGNORE_OTHER_WORKSPACES) | ||
2047 | ret = false; | ||
2048 | 2039 | ||
2049 | FluxboxWindow *cur = FocusControl::focusedFbWindow(); | 2040 | FluxboxWindow *cur = FocusControl::focusedFbWindow(); |
2050 | WinClient *client = FocusControl::focusedWindow(); | 2041 | WinClient *client = FocusControl::focusedWindow(); |
2051 | if (ret && cur && getRootTransientFor(&from) != getRootTransientFor(client)) | 2042 | if (cur && getRootTransientFor(&from) != getRootTransientFor(client)) |
2052 | ret = !(cur->isFullscreen() && getOnHead() == cur->getOnHead()) && | 2043 | ret = !(cur->isFullscreen() && getOnHead() == cur->getOnHead()) && |
2053 | !cur->isTyping(); | 2044 | !cur->isTyping(); |
2054 | 2045 | ||