aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-12-30 20:56:41 (GMT)
committerfluxgen <fluxgen>2003-12-30 20:56:41 (GMT)
commit3490c73f570cb43fcdea5c2f8770a379d721a73d (patch)
treec90fdca53a52d99bd5ef5f02356ab13f33eea639 /src/Window.cc
parent4a8a7a32d4e3df3ffa7dc68482ff8f1053d257eb (diff)
downloadfluxbox_pavel-3490c73f570cb43fcdea5c2f8770a379d721a73d.zip
fluxbox_pavel-3490c73f570cb43fcdea5c2f8770a379d721a73d.tar.bz2
fixed focus issue
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc40
1 files changed, 16 insertions, 24 deletions
diff --git a/src/Window.cc b/src/Window.cc
index be790ca..6cc3af9 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.257 2003/12/21 23:23:03 fluxgen Exp $ 25// $Id: Window.cc,v 1.258 2003/12/30 20:56:40 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -516,6 +516,8 @@ void FluxboxWindow::init() {
516 if (!place_window) 516 if (!place_window)
517 moveResize(frame().x(), frame().y(), frame().width(), frame().height()); 517 moveResize(frame().x(), frame().y(), frame().width(), frame().height());
518 518
519
520
519 screen().getWorkspace(m_workspace_number)->addWindow(*this, place_window); 521 screen().getWorkspace(m_workspace_number)->addWindow(*this, place_window);
520 522
521 if (shaded) { // start shaded 523 if (shaded) { // start shaded
@@ -895,14 +897,14 @@ void FluxboxWindow::updateClientLeftWindow() {
895 } 897 }
896} 898}
897 899
898bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput, long ignore_event) { 900bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) {
899 // make sure it's in our list 901 // make sure it's in our list
900 if (client.m_win != this) 902 if (client.m_win != this)
901 return false; 903 return false;
902 904
903 m_client = &client; 905 m_client = &client;
904 m_client->raise(); 906 m_client->raise();
905 if (setinput && setInputFocus(ignore_event)) { 907 if (setinput && setInputFocus()) {
906 frame().setLabelButtonFocus(*m_labelbuttons[m_client]); 908 frame().setLabelButtonFocus(*m_labelbuttons[m_client]);
907 return true; 909 return true;
908 } 910 }
@@ -1154,7 +1156,7 @@ void FluxboxWindow::moveResize(int new_x, int new_y,
1154// tried. A FocusqIn event should eventually arrive for that 1156// tried. A FocusqIn event should eventually arrive for that
1155// window if it actually got the focus, then setFocusedFlag is called, 1157// window if it actually got the focus, then setFocusedFlag is called,
1156// which updates all the graphics etc 1158// which updates all the graphics etc
1157bool FluxboxWindow::setInputFocus(long ignore_event) { 1159bool FluxboxWindow::setInputFocus() {
1158 1160
1159 if (((signed) (frame().x() + frame().width())) < 0) { 1161 if (((signed) (frame().x() + frame().width())) < 0) {
1160 if (((signed) (frame().y() + frame().height())) < 0) { 1162 if (((signed) (frame().y() + frame().height())) < 0) {
@@ -1215,13 +1217,6 @@ bool FluxboxWindow::setInputFocus(long ignore_event) {
1215 ret = m_client->sendFocus(); 1217 ret = m_client->sendFocus();
1216 } 1218 }
1217 1219
1218
1219 // People can ignore an event until the focus comes through
1220 // this is most likely to be an EnterNotify for sloppy focus
1221 if (ret && m_client->getFocusMode() != WinClient::F_NOINPUT && ignore_event != None)
1222 Fluxbox::instance()->addRedirectEvent(
1223 &screen(), ignore_event, None,
1224 FocusIn, m_client->window(), None);
1225 1220
1226 return ret; 1221 return ret;
1227} 1222}
@@ -2656,7 +2651,7 @@ void FluxboxWindow::setDecoration(Decoration decoration) {
2656// commit current decoration values to actual displayed things 2651// commit current decoration values to actual displayed things
2657void FluxboxWindow::applyDecorations(bool initial) { 2652void FluxboxWindow::applyDecorations(bool initial) {
2658 frame().clientArea().setBorderWidth(0); // client area bordered by other things 2653 frame().clientArea().setBorderWidth(0); // client area bordered by other things
2659 bool client_move = false; 2654
2660 2655
2661 int grav_x=0, grav_y=0; 2656 int grav_x=0, grav_y=0;
2662 // negate gravity 2657 // negate gravity
@@ -2666,6 +2661,8 @@ void FluxboxWindow::applyDecorations(bool initial) {
2666 if (decorations.border) 2661 if (decorations.border)
2667 border_width = frame().theme().border().width(); 2662 border_width = frame().theme().border().width();
2668 2663
2664 bool client_move = false;
2665
2669 if (initial || frame().window().borderWidth() != border_width) { 2666 if (initial || frame().window().borderWidth() != border_width) {
2670 client_move = true; 2667 client_move = true;
2671 frame().setBorderWidth(border_width); 2668 frame().setBorderWidth(border_width);
@@ -2768,16 +2765,7 @@ void FluxboxWindow::startMoving(Window win) {
2768 if (m_windowmenu.isVisible()) 2765 if (m_windowmenu.isVisible())
2769 m_windowmenu.hide(); 2766 m_windowmenu.hide();
2770 2767
2771 // The "stop" window and event aren't going to happen (since it's 2768 fluxbox->maskWindowEvents(screen().rootWindow().window(), this);
2772 // grabbed, so they are just so we can remove it in stopMoving)
2773 fluxbox->addRedirectEvent(&screen(),
2774 MotionNotify, screen().rootWindow().window(),
2775 MotionNotify, fbWindow().window(),
2776 fbWindow().window());
2777 fluxbox->addRedirectEvent(&screen(),
2778 ButtonRelease, screen().rootWindow().window(),
2779 ButtonRelease, fbWindow().window(),
2780 fbWindow().window());
2781 2769
2782 m_last_move_x = frame().x(); 2770 m_last_move_x = frame().x();
2783 m_last_move_y = frame().y(); 2771 m_last_move_y = frame().y();
@@ -2795,8 +2783,8 @@ void FluxboxWindow::stopMoving() {
2795 moving = false; 2783 moving = false;
2796 Fluxbox *fluxbox = Fluxbox::instance(); 2784 Fluxbox *fluxbox = Fluxbox::instance();
2797 2785
2798 fluxbox->removeRedirectEvent(MotionNotify, fbWindow().window()); 2786 fluxbox->maskWindowEvents(0, 0);
2799 fluxbox->removeRedirectEvent(ButtonRelease, fbWindow().window()); 2787
2800 2788
2801 if (! screen().doOpaqueMove()) { 2789 if (! screen().doOpaqueMove()) {
2802 parent().drawRectangle(screen().rootTheme().opGC(), 2790 parent().drawRectangle(screen().rootTheme().opGC(),
@@ -3026,6 +3014,10 @@ void FluxboxWindow::attachTo(int x, int y) {
3026 if (client) 3014 if (client)
3027 attach_to_win = client->fbwindow(); 3015 attach_to_win = client->fbwindow();
3028 3016
3017 cerr<<"client = "<<client<<", child = "<<hex<<child<<dec<<", fbwin = "<<attach_to_win<<endl;
3018
3019 cerr<<"client = "<<client<<", child = "<<hex<<child<<dec<<", fbwin = "<<attach_to_win<<endl;
3020
3029 if (attach_to_win != this && 3021 if (attach_to_win != this &&
3030 attach_to_win != 0) { 3022 attach_to_win != 0) {
3031 3023