diff options
author | fluxgen <fluxgen> | 2004-04-22 21:07:57 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2004-04-22 21:07:57 (GMT) |
commit | 09eade65d558dfc032ac415607fc2c6eb99aea19 (patch) | |
tree | ad0900955564f409f8edf85c2baebb19e611a04e /src | |
parent | 027741fbb409e945a2c3a632027c28981314b89a (diff) | |
download | fluxbox-09eade65d558dfc032ac415607fc2c6eb99aea19.zip fluxbox-09eade65d558dfc032ac415607fc2c6eb99aea19.tar.bz2 |
attach area, patch from Mathias Gumz
Diffstat (limited to 'src')
-rw-r--r-- | src/Window.cc | 13 | ||||
-rw-r--r-- | src/fluxbox.cc | 21 | ||||
-rw-r--r-- | src/fluxbox.hh | 5 |
3 files changed, 34 insertions, 5 deletions
diff --git a/src/Window.cc b/src/Window.cc index 0b306ef..ff93633 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Window.cc,v 1.281 2004/04/18 21:17:36 fluxgen Exp $ | 25 | // $Id: Window.cc,v 1.282 2004/04/22 21:07:57 fluxgen Exp $ |
26 | 26 | ||
27 | #include "Window.hh" | 27 | #include "Window.hh" |
28 | 28 | ||
@@ -3095,9 +3095,16 @@ void FluxboxWindow::attachTo(int x, int y) { | |||
3095 | // search for a fluxboxwindow | 3095 | // search for a fluxboxwindow |
3096 | WinClient *client = Fluxbox::instance()->searchWindow(child); | 3096 | WinClient *client = Fluxbox::instance()->searchWindow(child); |
3097 | FluxboxWindow *attach_to_win = 0; | 3097 | FluxboxWindow *attach_to_win = 0; |
3098 | if (client) | 3098 | if (client) { |
3099 | Fluxbox::TabsAttachArea area= Fluxbox::instance()->getTabsAttachArea(); | ||
3100 | if (area == Fluxbox::ATTACH_AREA_WINDOW) | ||
3099 | attach_to_win = client->fbwindow(); | 3101 | attach_to_win = client->fbwindow(); |
3100 | 3102 | else if (area == Fluxbox::ATTACH_AREA_TITLEBAR) { | |
3103 | if(client->fbwindow()->hasTitlebar() && | ||
3104 | client->fbwindow()->y() + client->fbwindow()->titlebarHeight() > dest_y) | ||
3105 | attach_to_win = client->fbwindow(); | ||
3106 | } | ||
3107 | } | ||
3101 | if (attach_to_win != this && | 3108 | if (attach_to_win != this && |
3102 | attach_to_win != 0) { | 3109 | attach_to_win != 0) { |
3103 | 3110 | ||
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 05b4ec2..fbcaa34 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: fluxbox.cc,v 1.239 2004/04/19 22:45:44 fluxgen Exp $ | 25 | // $Id: fluxbox.cc,v 1.240 2004/04/22 21:07:57 fluxgen Exp $ |
26 | 26 | ||
27 | #include "fluxbox.hh" | 27 | #include "fluxbox.hh" |
28 | 28 | ||
@@ -193,6 +193,15 @@ setFromString(char const *strval) { | |||
193 | } | 193 | } |
194 | 194 | ||
195 | template<> | 195 | template<> |
196 | void FbTk::Resource<Fluxbox::TabsAttachArea>:: | ||
197 | setFromString(char const *strval) { | ||
198 | if (strcasecmp(strval, "Titlebar")==0) | ||
199 | m_value= Fluxbox::ATTACH_AREA_TITLEBAR; | ||
200 | else | ||
201 | m_value= Fluxbox::ATTACH_AREA_WINDOW; | ||
202 | } | ||
203 | |||
204 | template<> | ||
196 | void FbTk::Resource<unsigned int>:: | 205 | void FbTk::Resource<unsigned int>:: |
197 | setFromString(const char *strval) { | 206 | setFromString(const char *strval) { |
198 | if (sscanf(strval, "%ul", &m_value) != 1) | 207 | if (sscanf(strval, "%ul", &m_value) != 1) |
@@ -256,6 +265,15 @@ getString() { | |||
256 | } | 265 | } |
257 | 266 | ||
258 | template<> | 267 | template<> |
268 | std::string FbTk::Resource<Fluxbox::TabsAttachArea>:: | ||
269 | getString() { | ||
270 | if (m_value == Fluxbox::ATTACH_AREA_TITLEBAR) | ||
271 | return "Titlebar"; | ||
272 | else | ||
273 | return "Window"; | ||
274 | } | ||
275 | |||
276 | template<> | ||
259 | string FbTk::Resource<unsigned int>:: | 277 | string FbTk::Resource<unsigned int>:: |
260 | getString() { | 278 | getString() { |
261 | char tmpstr[128]; | 279 | char tmpstr[128]; |
@@ -394,6 +412,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile | |||
394 | m_rc_titlebar_right(m_resourcemanager, | 412 | m_rc_titlebar_right(m_resourcemanager, |
395 | TitlebarList(&s_titlebar_right[0], &s_titlebar_right[3]), | 413 | TitlebarList(&s_titlebar_right[0], &s_titlebar_right[3]), |
396 | "session.titlebar.right", "Session.Titlebar.Right"), | 414 | "session.titlebar.right", "Session.Titlebar.Right"), |
415 | m_rc_tabs_attach_area(m_resourcemanager, ATTACH_AREA_WINDOW, "session.tabsAttachArea", "Session.TabsAttachArea"), | ||
397 | m_rc_cache_life(m_resourcemanager, 5, "session.cacheLife", "Session.CacheLife"), | 416 | m_rc_cache_life(m_resourcemanager, 5, "session.cacheLife", "Session.CacheLife"), |
398 | m_rc_cache_max(m_resourcemanager, 200, "session.cacheMax", "Session.CacheMax"), | 417 | m_rc_cache_max(m_resourcemanager, 200, "session.cacheMax", "Session.CacheMax"), |
399 | m_rc_auto_raise_delay(m_resourcemanager, 250, "session.autoRaiseDelay", "Session.AutoRaiseDelay"), | 418 | m_rc_auto_raise_delay(m_resourcemanager, 250, "session.autoRaiseDelay", "Session.AutoRaiseDelay"), |
diff --git a/src/fluxbox.hh b/src/fluxbox.hh index 2625ec0..ea10e5d 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: fluxbox.hh,v 1.86 2004/04/19 22:45:44 fluxgen Exp $ | 25 | // $Id: fluxbox.hh,v 1.87 2004/04/22 21:07:57 fluxgen Exp $ |
26 | 26 | ||
27 | #ifndef FLUXBOX_HH | 27 | #ifndef FLUXBOX_HH |
28 | #define FLUXBOX_HH | 28 | #define FLUXBOX_HH |
@@ -107,6 +107,7 @@ public: | |||
107 | 107 | ||
108 | /// obsolete | 108 | /// obsolete |
109 | enum Titlebar{SHADE=0, MINIMIZE, MAXIMIZE, CLOSE, STICK, MENU, EMPTY}; | 109 | enum Titlebar{SHADE=0, MINIMIZE, MAXIMIZE, CLOSE, STICK, MENU, EMPTY}; |
110 | enum TabsAttachArea{ATTACH_AREA_WINDOW= 0, ATTACH_AREA_TITLEBAR}; | ||
110 | 111 | ||
111 | 112 | ||
112 | 113 | ||
@@ -114,6 +115,7 @@ public: | |||
114 | 115 | ||
115 | inline const std::vector<Fluxbox::Titlebar>& getTitlebarRight() const { return *m_rc_titlebar_right; } | 116 | inline const std::vector<Fluxbox::Titlebar>& getTitlebarRight() const { return *m_rc_titlebar_right; } |
116 | inline const std::vector<Fluxbox::Titlebar>& getTitlebarLeft() const { return *m_rc_titlebar_left; } | 117 | inline const std::vector<Fluxbox::Titlebar>& getTitlebarLeft() const { return *m_rc_titlebar_left; } |
118 | inline const Fluxbox::TabsAttachArea getTabsAttachArea() const { return *m_rc_tabs_attach_area; } | ||
117 | inline const std::string &getStyleFilename() const { return *m_rc_stylefile; } | 119 | inline const std::string &getStyleFilename() const { return *m_rc_stylefile; } |
118 | 120 | ||
119 | inline const std::string &getMenuFilename() const { return *m_rc_menufile; } | 121 | inline const std::string &getMenuFilename() const { return *m_rc_menufile; } |
@@ -252,6 +254,7 @@ private: | |||
252 | 254 | ||
253 | 255 | ||
254 | FbTk::Resource<TitlebarList> m_rc_titlebar_left, m_rc_titlebar_right; | 256 | FbTk::Resource<TitlebarList> m_rc_titlebar_left, m_rc_titlebar_right; |
257 | FbTk::Resource<TabsAttachArea> m_rc_tabs_attach_area; | ||
255 | FbTk::Resource<unsigned int> m_rc_cache_life, m_rc_cache_max; | 258 | FbTk::Resource<unsigned int> m_rc_cache_life, m_rc_cache_max; |
256 | FbTk::Resource<time_t> m_rc_auto_raise_delay; | 259 | FbTk::Resource<time_t> m_rc_auto_raise_delay; |
257 | FbTk::Resource<bool> m_rc_use_mod1; /// temporary!, to disable mod1 for resize/move | 260 | FbTk::Resource<bool> m_rc_use_mod1; /// temporary!, to disable mod1 for resize/move |