Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 290649 | Differences between
and this patch

Collapse All | Expand All

(-)a/doc/asciidoc/fluxbox.txt (-2 / +4 lines)
Lines 1001-1010 This specifies the width of external tabs in pixels. Link Here
1001
+
1001
+
1002
Default: *64*
1002
Default: *64*
1003
1003
1004
*session.screen0.focusModel*: *ClickToFocus|MouseFocus*::
1004
*session.screen0.focusModel*: *ClickToFocus|MouseFocus|StrictMouseFocus*::
1005
This controls how windows gain focus via the mouse. With `ClickToFocus',
1005
This controls how windows gain focus via the mouse. With `ClickToFocus',
1006
the user must click on the window. With `MouseFocus', windows gain focus
1006
the user must click on the window. With `MouseFocus', windows gain focus
1007
whenever the mouse moves over them.
1007
whenever the mouse moves over them, but only when the mouse is moving. With
1008
`StrictMouseFocus', windows gain focus whenever the mouse enters any exposed
1009
area, even if this is due to layer changes, window movement, changing desktops, closing windows, etc.
1008
+
1010
+
1009
Default: *ClickToFocus*
1011
Default: *ClickToFocus*
1010
      
1012
      
(-)a/doc/fluxbox.1.in (-5 / +5 lines)
Lines 1-13 Link Here
1
'\" t
1
'\" t
2
.\"     Title: fluxbox
2
.\"     Title: fluxbox
3
.\"    Author: [see the "AUTHORS" section]
3
.\"    Author: [see the "AUTHORS" section]
4
.\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
4
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
5
.\"      Date: 01/14/2010
5
.\"      Date: 05/28/2010
6
.\"    Manual: Fluxbox Manual
6
.\"    Manual: Fluxbox Manual
7
.\"    Source: fluxbox.txt
7
.\"    Source: fluxbox.txt
8
.\"  Language: English
8
.\"  Language: English
9
.\"
9
.\"
10
.TH "FLUXBOX" "1" "01/14/2010" "fluxbox\&.txt" "Fluxbox Manual"
10
.TH "FLUXBOX" "1" "05/28/2010" "fluxbox\&.txt" "Fluxbox Manual"
11
.\" -----------------------------------------------------------------
11
.\" -----------------------------------------------------------------
12
.\" * set default formatting
12
.\" * set default formatting
13
.\" -----------------------------------------------------------------
13
.\" -----------------------------------------------------------------
Lines 1693-1701 Default: Link Here
1693
\fB64\fR
1693
\fB64\fR
1694
.RE
1694
.RE
1695
.PP
1695
.PP
1696
\fBsession\&.screen0\&.focusModel\fR: \fBClickToFocus|MouseFocus\fR
1696
\fBsession\&.screen0\&.focusModel\fR: \fBClickToFocus|MouseFocus|StrictMouseFocus\fR
1697
.RS 4
1697
.RS 4
1698
This controls how windows gain focus via the mouse\&. With \(oqClickToFocus\(cq, the user must click on the window\&. With \(oqMouseFocus\(cq, windows gain focus whenever the mouse moves over them\&.
1698
This controls how windows gain focus via the mouse\&. With \(oqClickToFocus\(cq, the user must click on the window\&. With \(oqMouseFocus\(cq, windows gain focus whenever the mouse moves over them, but only when the mouse is moving\&. With \(oqStrictMouseFocus\(cq, windows gain focus whenever the mouse enters any exposed area, even if this is due to layer changes, window movement, changing desktops, closing windows, etc\&.
1699
.sp
1699
.sp
1700
Default:
1700
Default:
1701
\fBClickToFocus\fR
1701
\fBClickToFocus\fR
(-)a/nls/fluxbox-nls.hh (+1 lines)
Lines 84-89 enum { Link Here
84
        ConfigmenuMaxIgnoreInc = 27,
84
        ConfigmenuMaxIgnoreInc = 27,
85
        ConfigmenuMaxDisableMove = 28,
85
        ConfigmenuMaxDisableMove = 28,
86
        ConfigmenuMaxDisableResize = 29,
86
        ConfigmenuMaxDisableResize = 29,
87
	ConfigmenuStrictMouseFocus = 30,
87
88
88
	EwmhSet = 5,
89
	EwmhSet = 5,
89
	EwmhOutOfMemoryClientList = 1,
90
	EwmhOutOfMemoryClientList = 1,
(-)a/src/ClientMenu.cc (-1 / +6 lines)
Lines 25-30 Link Here
25
#include "Screen.hh"
25
#include "Screen.hh"
26
#include "Window.hh"
26
#include "Window.hh"
27
#include "WindowCmd.hh"
27
#include "WindowCmd.hh"
28
#include "FocusControl.hh"
28
#include <X11/keysym.h>
29
#include <X11/keysym.h>
29
30
30
#include "FbTk/MenuItem.hh"
31
#include "FbTk/MenuItem.hh"
Lines 56-63 public: Link Here
56
57
57
        m_client.focus();
58
        m_client.focus();
58
        fbwin->raise();
59
        fbwin->raise();
59
        if ((mods & ControlMask) == 0)
60
        if ((mods & ControlMask) == 0) {
61
            // Ignore any focus changes due to this menu closing
62
            // (even in StrictMouseFocus mode)
63
            m_client.screen().focusControl().ignoreAtPointer(true);
60
            parent->hide();
64
            parent->hide();
65
        }
61
    }
66
    }
62
67
63
    const std::string &label() const { return m_client.title(); }
68
    const std::string &label() const { return m_client.title(); }
(-)a/src/FocusControl.cc (-5 / +19 lines)
Lines 401-421 void FocusControl::dirFocus(FluxboxWindow &win, FocusDir dir) { Link Here
401
401
402
}
402
}
403
403
404
void FocusControl::ignoreAtPointer()
404
void FocusControl::ignoreAtPointer(bool force)
405
{
405
{
406
    int ignore_i;
406
    int ignore_i, ignore_x, ignore_y;
407
    unsigned int ignore_ui;
407
    unsigned int ignore_ui;
408
    Window ignore_w;
408
    Window ignore_w;
409
409
410
    XQueryPointer(m_screen.rootWindow().display(),
410
    XQueryPointer(m_screen.rootWindow().display(),
411
        m_screen.rootWindow().window(), &ignore_w, &ignore_w,
411
        m_screen.rootWindow().window(), &ignore_w, &ignore_w,
412
        &m_ignore_mouse_x, &m_ignore_mouse_y,
412
        &ignore_x, &ignore_y,
413
        &ignore_i, &ignore_i, &ignore_ui);
413
        &ignore_i, &ignore_i, &ignore_ui);
414
415
    this->ignoreAt(ignore_x, ignore_y, force);
416
}
417
418
void FocusControl::ignoreAt(int x, int y, bool force)
419
{
420
	if (force || this->focusModel() == MOUSEFOCUS) {
421
		m_ignore_mouse_x = x; m_ignore_mouse_y = y;
422
	}
414
}
423
}
415
424
416
void FocusControl::ignoreAt(int x, int y)
425
void FocusControl::ignoreCancel()
417
{
426
{
418
    m_ignore_mouse_x = x; m_ignore_mouse_y = y;
427
	m_ignore_mouse_x = m_ignore_mouse_y = -1;
419
}
428
}
420
429
421
bool FocusControl::isIgnored(int x, int y)
430
bool FocusControl::isIgnored(int x, int y)
Lines 489-494 void FocusControl::revertFocus(BScreen &screen) { Link Here
489
        else {
498
        else {
490
            switch (screen.focusControl().focusModel()) {
499
            switch (screen.focusControl().focusModel()) {
491
            case FocusControl::MOUSEFOCUS:
500
            case FocusControl::MOUSEFOCUS:
501
            case FocusControl::STRICTMOUSEFOCUS:
492
                XSetInputFocus(screen.rootWindow().display(),
502
                XSetInputFocus(screen.rootWindow().display(),
493
                               PointerRoot, None, CurrentTime);
503
                               PointerRoot, None, CurrentTime);
494
                break;
504
                break;
Lines 593-598 std::string FbTk::Resource<FocusControl::FocusModel>::getString() const { Link Here
593
    switch (m_value) {
603
    switch (m_value) {
594
    case FocusControl::MOUSEFOCUS:
604
    case FocusControl::MOUSEFOCUS:
595
        return string("MouseFocus");
605
        return string("MouseFocus");
606
    case FocusControl::STRICTMOUSEFOCUS:
607
        return string("StrictMouseFocus");
596
    case FocusControl::CLICKFOCUS:
608
    case FocusControl::CLICKFOCUS:
597
        return string("ClickFocus");
609
        return string("ClickFocus");
598
    }
610
    }
Lines 605-610 void FbTk::Resource<FocusControl::FocusModel>:: Link Here
605
setFromString(char const *strval) {
617
setFromString(char const *strval) {
606
    if (strcasecmp(strval, "MouseFocus") == 0)
618
    if (strcasecmp(strval, "MouseFocus") == 0)
607
        m_value = FocusControl::MOUSEFOCUS;
619
        m_value = FocusControl::MOUSEFOCUS;
620
    else if (strcasecmp(strval, "StrictMouseFocus") == 0)
621
        m_value = FocusControl::STRICTMOUSEFOCUS;
608
    else if (strcasecmp(strval, "ClickToFocus") == 0)
622
    else if (strcasecmp(strval, "ClickToFocus") == 0)
609
        m_value = FocusControl::CLICKFOCUS;
623
        m_value = FocusControl::CLICKFOCUS;
610
    else
624
    else
(-)a/src/FocusControl.hh (-5 / +12 lines)
Lines 42-49 public: Link Here
42
    typedef std::list<Focusable *> Focusables;
42
    typedef std::list<Focusable *> Focusables;
43
    /// main focus model
43
    /// main focus model
44
    enum FocusModel { 
44
    enum FocusModel { 
45
        MOUSEFOCUS = 0, ///< focus follows mouse
45
        MOUSEFOCUS = 0,  ///< focus follows mouse, but only when the mouse is moving
46
        CLICKFOCUS      ///< focus on click
46
        CLICKFOCUS,      ///< focus on click
47
        STRICTMOUSEFOCUS ///< focus always follows mouse, even when stationary
47
    };
48
    };
48
    /// focus model for tabs
49
    /// focus model for tabs
49
    enum TabFocusModel { 
50
    enum TabFocusModel { 
Lines 90-103 public: Link Here
90
     */
91
     */
91
    void dirFocus(FluxboxWindow &win, FocusDir dir);
92
    void dirFocus(FluxboxWindow &win, FocusDir dir);
92
    /// @return true if focus mode is mouse focus
93
    /// @return true if focus mode is mouse focus
93
    bool isMouseFocus() const { return focusModel() == MOUSEFOCUS; }
94
    bool isMouseFocus() const { return focusModel() != CLICKFOCUS; }
94
    /// @return true if tab focus mode is mouse tab focus
95
    /// @return true if tab focus mode is mouse tab focus
95
    bool isMouseTabFocus() const { return tabFocusModel() == MOUSETABFOCUS; }
96
    bool isMouseTabFocus() const { return tabFocusModel() == MOUSETABFOCUS; }
96
97
97
    /// Set the "ignore" pointer location to the current pointer location
98
    /// Set the "ignore" pointer location to the current pointer location
98
    void ignoreAtPointer();
99
    /// @param force If true, ignore even in StrictMouseFocus mode
100
    void ignoreAtPointer(bool force = false);
99
    /// Set the "ignore" pointer location to the given coordinates
101
    /// Set the "ignore" pointer location to the given coordinates
100
    void ignoreAt(int x, int y);
102
    /// @param x Current X position of the pointer
103
    /// @param y Current Y position of the pointer
104
    /// @param force If true, ignore even in StrictMouseFocus mode
105
    void ignoreAt(int x, int y, bool force = false);
106
    /// unset the "ignore" pointer location
107
    void ignoreCancel();
101
    /// @return true if events at the given X/Y coordinate should be ignored
108
    /// @return true if events at the given X/Y coordinate should be ignored
102
    /// (ie, they were previously cached via one of the ignoreAt calls)
109
    /// (ie, they were previously cached via one of the ignoreAt calls)
103
    bool isIgnored(int x, int y);
110
    bool isIgnored(int x, int y);
(-)a/src/Screen.cc (-1 / +6 lines)
Lines 1555-1562 void BScreen::setupConfigmenu(FbTk::Menu &menu) { Link Here
1555
               "Click To Focus", "Click to focus",
1555
               "Click To Focus", "Click to focus",
1556
               FocusControl::CLICKFOCUS);
1556
               FocusControl::CLICKFOCUS);
1557
    _FOCUSITEM(Configmenu, MouseFocus,
1557
    _FOCUSITEM(Configmenu, MouseFocus,
1558
               "Mouse Focus", "Mouse Focus",
1558
               "Mouse Focus (Keyboard Friendly)",
1559
               "Mouse Focus (Keyboard Friendly)",
1559
               FocusControl::MOUSEFOCUS);
1560
               FocusControl::MOUSEFOCUS);
1561
    _FOCUSITEM(Configmenu, StrictMouseFocus,
1562
               "Mouse Focus (Strict)",
1563
               "Mouse Focus (Strict)",
1564
               FocusControl::STRICTMOUSEFOCUS);
1560
#undef _FOCUSITEM
1565
#undef _FOCUSITEM
1561
1566
1562
    focus_menu->insert(new FbTk::MenuSeparator());
1567
    focus_menu->insert(new FbTk::MenuSeparator());

Return to bug 290649