diff options
author | markt <markt> | 2007-03-21 21:48:34 (GMT) |
---|---|---|
committer | markt <markt> | 2007-03-21 21:48:34 (GMT) |
commit | 51bcee666516ffdbe205b0e74ca209f82fcb1f31 (patch) | |
tree | 6f4b21b34882178962958bf64ef9c9072abced50 /src/Window.cc | |
parent | 54dee2bff7242b2f6d3f6814679d0024e3189e86 (diff) | |
download | fluxbox-51bcee666516ffdbe205b0e74ca209f82fcb1f31.zip fluxbox-51bcee666516ffdbe205b0e74ca209f82fcb1f31.tar.bz2 |
added Focusable.hh -- a base class for all focusable windows
Diffstat (limited to 'src/Window.cc')
-rw-r--r-- | src/Window.cc | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/Window.cc b/src/Window.cc index 8e6b887..1eb214a 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -239,6 +239,7 @@ int FluxboxWindow::s_num_grabs = 0; | |||
239 | 239 | ||
240 | FluxboxWindow::FluxboxWindow(WinClient &client, FbWinFrameTheme &tm, | 240 | FluxboxWindow::FluxboxWindow(WinClient &client, FbWinFrameTheme &tm, |
241 | FbTk::XLayer &layer): | 241 | FbTk::XLayer &layer): |
242 | Focusable(this), | ||
242 | oplock(false), | 243 | oplock(false), |
243 | m_hintsig(*this), | 244 | m_hintsig(*this), |
244 | m_statesig(*this), | 245 | m_statesig(*this), |
@@ -988,7 +989,7 @@ bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) { | |||
988 | // frame focused doesn't necessarily mean input focused | 989 | // frame focused doesn't necessarily mean input focused |
989 | frame().setLabelButtonFocus(*m_labelbuttons[m_client]); | 990 | frame().setLabelButtonFocus(*m_labelbuttons[m_client]); |
990 | 991 | ||
991 | if (setinput && setInputFocus()) { | 992 | if (setinput && focus()) { |
992 | return true; | 993 | return true; |
993 | } | 994 | } |
994 | 995 | ||
@@ -1319,7 +1320,7 @@ void FluxboxWindow::moveResizeForClient(int new_x, int new_y, | |||
1319 | // tried. A FocusqIn event should eventually arrive for that | 1320 | // tried. A FocusqIn event should eventually arrive for that |
1320 | // window if it actually got the focus, then setFocusedFlag is called, | 1321 | // window if it actually got the focus, then setFocusedFlag is called, |
1321 | // which updates all the graphics etc | 1322 | // which updates all the graphics etc |
1322 | bool FluxboxWindow::setInputFocus() { | 1323 | bool FluxboxWindow::focus() { |
1323 | 1324 | ||
1324 | if (((signed) (frame().x() + frame().width())) < 0) { | 1325 | if (((signed) (frame().x() + frame().width())) < 0) { |
1325 | if (((signed) (frame().y() + frame().height())) < 0) { | 1326 | if (((signed) (frame().y() + frame().height())) < 0) { |
@@ -1523,7 +1524,7 @@ void FluxboxWindow::deiconify(bool reassoc, bool do_raise) { | |||
1523 | 1524 | ||
1524 | // focus new, OR if it's the only window on the workspace | 1525 | // focus new, OR if it's the only window on the workspace |
1525 | if (was_iconic && (screen().focusControl().focusNew() || screen().currentWorkspace()->numberOfWindows() == 1)) | 1526 | if (was_iconic && (screen().focusControl().focusNew() || screen().currentWorkspace()->numberOfWindows() == 1)) |
1526 | setInputFocus(); | 1527 | focus(); |
1527 | 1528 | ||
1528 | 1529 | ||
1529 | oplock = false; | 1530 | oplock = false; |
@@ -2603,9 +2604,8 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) { | |||
2603 | 2604 | ||
2604 | if (be.button == 1 || (be.button == 3 && | 2605 | if (be.button == 1 || (be.button == 3 && |
2605 | be.state == Fluxbox::instance()->getModKey())) { | 2606 | be.state == Fluxbox::instance()->getModKey())) { |
2606 | if ( (! focused) ) { //check focus | 2607 | if (!focused) //check focus |
2607 | setInputFocus(); | 2608 | focus(); |
2608 | } | ||
2609 | 2609 | ||
2610 | if (frame().window().window() == be.window || frame().tabcontainer().window() == be.window) { | 2610 | if (frame().window().window() == be.window || frame().tabcontainer().window() == be.window) { |
2611 | if (screen().clickRaises()) | 2611 | if (screen().clickRaises()) |
@@ -2994,7 +2994,7 @@ void FluxboxWindow::enterNotifyEvent(XCrossingEvent &ev) { | |||
2994 | XCheckIfEvent(display, &dummy, queueScanner, (char *) &sa); | 2994 | XCheckIfEvent(display, &dummy, queueScanner, (char *) &sa); |
2995 | 2995 | ||
2996 | if ((!sa.leave || sa.inferior) && !screen().focusControl().isCycling() ) { | 2996 | if ((!sa.leave || sa.inferior) && !screen().focusControl().isCycling() ) { |
2997 | setInputFocus(); | 2997 | focus(); |
2998 | } | 2998 | } |
2999 | } | 2999 | } |
3000 | } | 3000 | } |
@@ -3246,7 +3246,7 @@ void FluxboxWindow::stopMoving(bool interrupted) { | |||
3246 | if (m_workspace_number != screen().currentWorkspaceID()) { | 3246 | if (m_workspace_number != screen().currentWorkspaceID()) { |
3247 | screen().reassociateWindow(this, screen().currentWorkspaceID(), true); | 3247 | screen().reassociateWindow(this, screen().currentWorkspaceID(), true); |
3248 | frame().show(); | 3248 | frame().show(); |
3249 | setInputFocus(); | 3249 | focus(); |
3250 | } | 3250 | } |
3251 | } | 3251 | } |
3252 | fluxbox->ungrab(); | 3252 | fluxbox->ungrab(); |
@@ -3282,7 +3282,7 @@ void FluxboxWindow::resumeMoving() { | |||
3282 | 3282 | ||
3283 | if (m_workspace_number == screen().currentWorkspaceID()) { | 3283 | if (m_workspace_number == screen().currentWorkspaceID()) { |
3284 | frame().show(); | 3284 | frame().show(); |
3285 | setInputFocus(); | 3285 | focus(); |
3286 | } | 3286 | } |
3287 | 3287 | ||
3288 | FbTk::App::instance()->sync(false); | 3288 | FbTk::App::instance()->sync(false); |
@@ -3664,14 +3664,13 @@ FbTk::Menu &FluxboxWindow::menu() { | |||
3664 | return screen().windowMenu(); | 3664 | return screen().windowMenu(); |
3665 | } | 3665 | } |
3666 | 3666 | ||
3667 | const FbTk::FbPixmap &FluxboxWindow::iconPixmap() const { return m_client->iconPixmap(); } | 3667 | const FbTk::FbPixmap &FluxboxWindow::iconPixmap() const { |
3668 | const FbTk::FbPixmap &FluxboxWindow::iconMask() const { return m_client->iconMask(); } | 3668 | return m_client->iconPixmap(); |
3669 | |||
3670 | const bool FluxboxWindow::usePixmap() const { | ||
3671 | return m_client ? m_client->usePixmap() : false; | ||
3672 | } | 3669 | } |
3673 | 3670 | ||
3674 | const bool FluxboxWindow::useMask() const { return m_client->useMask(); } | 3671 | const FbTk::FbPixmap &FluxboxWindow::iconMask() const { |
3672 | return m_client->iconMask(); | ||
3673 | } | ||
3675 | 3674 | ||
3676 | const FbTk::Menu &FluxboxWindow::menu() const { | 3675 | const FbTk::Menu &FluxboxWindow::menu() const { |
3677 | return screen().windowMenu(); | 3676 | return screen().windowMenu(); |