attach area, patch from Mathias Gumz

This commit is contained in:
fluxgen 2004-04-22 21:07:57 +00:00
parent 027741fbb4
commit 09eade65d5
3 changed files with 34 additions and 5 deletions

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: Window.cc,v 1.281 2004/04/18 21:17:36 fluxgen Exp $
// $Id: Window.cc,v 1.282 2004/04/22 21:07:57 fluxgen Exp $
#include "Window.hh"
@ -3095,9 +3095,16 @@ void FluxboxWindow::attachTo(int x, int y) {
// search for a fluxboxwindow
WinClient *client = Fluxbox::instance()->searchWindow(child);
FluxboxWindow *attach_to_win = 0;
if (client)
if (client) {
Fluxbox::TabsAttachArea area= Fluxbox::instance()->getTabsAttachArea();
if (area == Fluxbox::ATTACH_AREA_WINDOW)
attach_to_win = client->fbwindow();
else if (area == Fluxbox::ATTACH_AREA_TITLEBAR) {
if(client->fbwindow()->hasTitlebar() &&
client->fbwindow()->y() + client->fbwindow()->titlebarHeight() > dest_y)
attach_to_win = client->fbwindow();
}
}
if (attach_to_win != this &&
attach_to_win != 0) {

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: fluxbox.cc,v 1.239 2004/04/19 22:45:44 fluxgen Exp $
// $Id: fluxbox.cc,v 1.240 2004/04/22 21:07:57 fluxgen Exp $
#include "fluxbox.hh"
@ -192,6 +192,15 @@ setFromString(char const *strval) {
}
}
template<>
void FbTk::Resource<Fluxbox::TabsAttachArea>::
setFromString(char const *strval) {
if (strcasecmp(strval, "Titlebar")==0)
m_value= Fluxbox::ATTACH_AREA_TITLEBAR;
else
m_value= Fluxbox::ATTACH_AREA_WINDOW;
}
template<>
void FbTk::Resource<unsigned int>::
setFromString(const char *strval) {
@ -255,6 +264,15 @@ getString() {
return retval;
}
template<>
std::string FbTk::Resource<Fluxbox::TabsAttachArea>::
getString() {
if (m_value == Fluxbox::ATTACH_AREA_TITLEBAR)
return "Titlebar";
else
return "Window";
}
template<>
string FbTk::Resource<unsigned int>::
getString() {
@ -394,6 +412,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
m_rc_titlebar_right(m_resourcemanager,
TitlebarList(&s_titlebar_right[0], &s_titlebar_right[3]),
"session.titlebar.right", "Session.Titlebar.Right"),
m_rc_tabs_attach_area(m_resourcemanager, ATTACH_AREA_WINDOW, "session.tabsAttachArea", "Session.TabsAttachArea"),
m_rc_cache_life(m_resourcemanager, 5, "session.cacheLife", "Session.CacheLife"),
m_rc_cache_max(m_resourcemanager, 200, "session.cacheMax", "Session.CacheMax"),
m_rc_auto_raise_delay(m_resourcemanager, 250, "session.autoRaiseDelay", "Session.AutoRaiseDelay"),

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: fluxbox.hh,v 1.86 2004/04/19 22:45:44 fluxgen Exp $
// $Id: fluxbox.hh,v 1.87 2004/04/22 21:07:57 fluxgen Exp $
#ifndef FLUXBOX_HH
#define FLUXBOX_HH
@ -107,6 +107,7 @@ public:
/// obsolete
enum Titlebar{SHADE=0, MINIMIZE, MAXIMIZE, CLOSE, STICK, MENU, EMPTY};
enum TabsAttachArea{ATTACH_AREA_WINDOW= 0, ATTACH_AREA_TITLEBAR};
@ -114,6 +115,7 @@ public:
inline const std::vector<Fluxbox::Titlebar>& getTitlebarRight() const { return *m_rc_titlebar_right; }
inline const std::vector<Fluxbox::Titlebar>& getTitlebarLeft() const { return *m_rc_titlebar_left; }
inline const Fluxbox::TabsAttachArea getTabsAttachArea() const { return *m_rc_tabs_attach_area; }
inline const std::string &getStyleFilename() const { return *m_rc_stylefile; }
inline const std::string &getMenuFilename() const { return *m_rc_menufile; }
@ -252,6 +254,7 @@ private:
FbTk::Resource<TitlebarList> m_rc_titlebar_left, m_rc_titlebar_right;
FbTk::Resource<TabsAttachArea> m_rc_tabs_attach_area;
FbTk::Resource<unsigned int> m_rc_cache_life, m_rc_cache_max;
FbTk::Resource<time_t> m_rc_auto_raise_delay;
FbTk::Resource<bool> m_rc_use_mod1; /// temporary!, to disable mod1 for resize/move