fixed focus issue
This commit is contained in:
parent
4a8a7a32d4
commit
3490c73f57
5 changed files with 61 additions and 196 deletions
|
@ -19,7 +19,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: WinClient.cc,v 1.36 2003/12/21 15:24:28 rathnor Exp $
|
// $Id: WinClient.cc,v 1.37 2003/12/30 20:56:41 fluxgen Exp $
|
||||||
|
|
||||||
#include "WinClient.hh"
|
#include "WinClient.hh"
|
||||||
|
|
||||||
|
@ -118,10 +118,8 @@ WinClient::~WinClient() {
|
||||||
if (m_blackbox_hint != 0)
|
if (m_blackbox_hint != 0)
|
||||||
XFree(m_blackbox_hint);
|
XFree(m_blackbox_hint);
|
||||||
|
|
||||||
if (window()) {
|
if (window())
|
||||||
fluxbox->removeWindowSearch(window());
|
fluxbox->removeWindowSearch(window());
|
||||||
fluxbox->removeRedirectEvent(None, window());
|
|
||||||
}
|
|
||||||
|
|
||||||
m_win = 0;
|
m_win = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Window.cc,v 1.257 2003/12/21 23:23:03 fluxgen Exp $
|
// $Id: Window.cc,v 1.258 2003/12/30 20:56:40 fluxgen Exp $
|
||||||
|
|
||||||
#include "Window.hh"
|
#include "Window.hh"
|
||||||
|
|
||||||
|
@ -516,6 +516,8 @@ void FluxboxWindow::init() {
|
||||||
if (!place_window)
|
if (!place_window)
|
||||||
moveResize(frame().x(), frame().y(), frame().width(), frame().height());
|
moveResize(frame().x(), frame().y(), frame().width(), frame().height());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
screen().getWorkspace(m_workspace_number)->addWindow(*this, place_window);
|
screen().getWorkspace(m_workspace_number)->addWindow(*this, place_window);
|
||||||
|
|
||||||
if (shaded) { // start shaded
|
if (shaded) { // start shaded
|
||||||
|
@ -895,14 +897,14 @@ void FluxboxWindow::updateClientLeftWindow() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput, long ignore_event) {
|
bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) {
|
||||||
// make sure it's in our list
|
// make sure it's in our list
|
||||||
if (client.m_win != this)
|
if (client.m_win != this)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_client = &client;
|
m_client = &client;
|
||||||
m_client->raise();
|
m_client->raise();
|
||||||
if (setinput && setInputFocus(ignore_event)) {
|
if (setinput && setInputFocus()) {
|
||||||
frame().setLabelButtonFocus(*m_labelbuttons[m_client]);
|
frame().setLabelButtonFocus(*m_labelbuttons[m_client]);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1154,7 +1156,7 @@ void FluxboxWindow::moveResize(int new_x, int new_y,
|
||||||
// tried. A FocusqIn event should eventually arrive for that
|
// tried. A FocusqIn event should eventually arrive for that
|
||||||
// window if it actually got the focus, then setFocusedFlag is called,
|
// window if it actually got the focus, then setFocusedFlag is called,
|
||||||
// which updates all the graphics etc
|
// which updates all the graphics etc
|
||||||
bool FluxboxWindow::setInputFocus(long ignore_event) {
|
bool FluxboxWindow::setInputFocus() {
|
||||||
|
|
||||||
if (((signed) (frame().x() + frame().width())) < 0) {
|
if (((signed) (frame().x() + frame().width())) < 0) {
|
||||||
if (((signed) (frame().y() + frame().height())) < 0) {
|
if (((signed) (frame().y() + frame().height())) < 0) {
|
||||||
|
@ -1216,13 +1218,6 @@ bool FluxboxWindow::setInputFocus(long ignore_event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// People can ignore an event until the focus comes through
|
|
||||||
// this is most likely to be an EnterNotify for sloppy focus
|
|
||||||
if (ret && m_client->getFocusMode() != WinClient::F_NOINPUT && ignore_event != None)
|
|
||||||
Fluxbox::instance()->addRedirectEvent(
|
|
||||||
&screen(), ignore_event, None,
|
|
||||||
FocusIn, m_client->window(), None);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2656,7 +2651,7 @@ void FluxboxWindow::setDecoration(Decoration decoration) {
|
||||||
// commit current decoration values to actual displayed things
|
// commit current decoration values to actual displayed things
|
||||||
void FluxboxWindow::applyDecorations(bool initial) {
|
void FluxboxWindow::applyDecorations(bool initial) {
|
||||||
frame().clientArea().setBorderWidth(0); // client area bordered by other things
|
frame().clientArea().setBorderWidth(0); // client area bordered by other things
|
||||||
bool client_move = false;
|
|
||||||
|
|
||||||
int grav_x=0, grav_y=0;
|
int grav_x=0, grav_y=0;
|
||||||
// negate gravity
|
// negate gravity
|
||||||
|
@ -2666,6 +2661,8 @@ void FluxboxWindow::applyDecorations(bool initial) {
|
||||||
if (decorations.border)
|
if (decorations.border)
|
||||||
border_width = frame().theme().border().width();
|
border_width = frame().theme().border().width();
|
||||||
|
|
||||||
|
bool client_move = false;
|
||||||
|
|
||||||
if (initial || frame().window().borderWidth() != border_width) {
|
if (initial || frame().window().borderWidth() != border_width) {
|
||||||
client_move = true;
|
client_move = true;
|
||||||
frame().setBorderWidth(border_width);
|
frame().setBorderWidth(border_width);
|
||||||
|
@ -2768,16 +2765,7 @@ void FluxboxWindow::startMoving(Window win) {
|
||||||
if (m_windowmenu.isVisible())
|
if (m_windowmenu.isVisible())
|
||||||
m_windowmenu.hide();
|
m_windowmenu.hide();
|
||||||
|
|
||||||
// The "stop" window and event aren't going to happen (since it's
|
fluxbox->maskWindowEvents(screen().rootWindow().window(), this);
|
||||||
// grabbed, so they are just so we can remove it in stopMoving)
|
|
||||||
fluxbox->addRedirectEvent(&screen(),
|
|
||||||
MotionNotify, screen().rootWindow().window(),
|
|
||||||
MotionNotify, fbWindow().window(),
|
|
||||||
fbWindow().window());
|
|
||||||
fluxbox->addRedirectEvent(&screen(),
|
|
||||||
ButtonRelease, screen().rootWindow().window(),
|
|
||||||
ButtonRelease, fbWindow().window(),
|
|
||||||
fbWindow().window());
|
|
||||||
|
|
||||||
m_last_move_x = frame().x();
|
m_last_move_x = frame().x();
|
||||||
m_last_move_y = frame().y();
|
m_last_move_y = frame().y();
|
||||||
|
@ -2795,8 +2783,8 @@ void FluxboxWindow::stopMoving() {
|
||||||
moving = false;
|
moving = false;
|
||||||
Fluxbox *fluxbox = Fluxbox::instance();
|
Fluxbox *fluxbox = Fluxbox::instance();
|
||||||
|
|
||||||
fluxbox->removeRedirectEvent(MotionNotify, fbWindow().window());
|
fluxbox->maskWindowEvents(0, 0);
|
||||||
fluxbox->removeRedirectEvent(ButtonRelease, fbWindow().window());
|
|
||||||
|
|
||||||
if (! screen().doOpaqueMove()) {
|
if (! screen().doOpaqueMove()) {
|
||||||
parent().drawRectangle(screen().rootTheme().opGC(),
|
parent().drawRectangle(screen().rootTheme().opGC(),
|
||||||
|
@ -3026,6 +3014,10 @@ void FluxboxWindow::attachTo(int x, int y) {
|
||||||
if (client)
|
if (client)
|
||||||
attach_to_win = client->fbwindow();
|
attach_to_win = client->fbwindow();
|
||||||
|
|
||||||
|
cerr<<"client = "<<client<<", child = "<<hex<<child<<dec<<", fbwin = "<<attach_to_win<<endl;
|
||||||
|
|
||||||
|
cerr<<"client = "<<client<<", child = "<<hex<<child<<dec<<", fbwin = "<<attach_to_win<<endl;
|
||||||
|
|
||||||
if (attach_to_win != this &&
|
if (attach_to_win != this &&
|
||||||
attach_to_win != 0) {
|
attach_to_win != 0) {
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Window.hh,v 1.104 2003/12/18 18:03:22 fluxgen Exp $
|
// $Id: Window.hh,v 1.105 2003/12/30 20:56:40 fluxgen Exp $
|
||||||
|
|
||||||
#ifndef WINDOW_HH
|
#ifndef WINDOW_HH
|
||||||
#define WINDOW_HH
|
#define WINDOW_HH
|
||||||
|
@ -168,14 +168,14 @@ public:
|
||||||
/// remove client from client list
|
/// remove client from client list
|
||||||
bool removeClient(WinClient &client);
|
bool removeClient(WinClient &client);
|
||||||
/// set new current client and raise it
|
/// set new current client and raise it
|
||||||
bool setCurrentClient(WinClient &client, bool setinput = true, long ignore_event = 0);
|
bool setCurrentClient(WinClient &client, bool setinput = true);
|
||||||
WinClient *findClient(Window win);
|
WinClient *findClient(Window win);
|
||||||
void nextClient();
|
void nextClient();
|
||||||
void prevClient();
|
void prevClient();
|
||||||
void moveClientLeft();
|
void moveClientLeft();
|
||||||
void moveClientRight();
|
void moveClientRight();
|
||||||
|
|
||||||
bool setInputFocus(long ignore_event = 0);
|
bool setInputFocus();
|
||||||
void raiseAndFocus() { raise(); setInputFocus(); }
|
void raiseAndFocus() { raise(); setInputFocus(); }
|
||||||
void setFocusFlag(bool flag);
|
void setFocusFlag(bool flag);
|
||||||
// map this window
|
// map this window
|
||||||
|
|
162
src/fluxbox.cc
162
src/fluxbox.cc
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: fluxbox.cc,v 1.214 2003/12/21 22:42:31 fluxgen Exp $
|
// $Id: fluxbox.cc,v 1.215 2003/12/30 20:56:40 fluxgen Exp $
|
||||||
|
|
||||||
#include "fluxbox.hh"
|
#include "fluxbox.hh"
|
||||||
|
|
||||||
|
@ -194,13 +194,6 @@ setFromString(const char *strval) {
|
||||||
setDefaultValue();
|
setDefaultValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
|
||||||
void FbTk::Resource<long>::
|
|
||||||
setFromString(const char *strval) {
|
|
||||||
if (sscanf(strval, "%ld", &m_value) != 1)
|
|
||||||
setDefaultValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------
|
//-----------------------------------------------------------------
|
||||||
//---- manipulators for int, bool, and some enums with Resource ---
|
//---- manipulators for int, bool, and some enums with Resource ---
|
||||||
//-----------------------------------------------------------------
|
//-----------------------------------------------------------------
|
||||||
|
@ -265,14 +258,6 @@ getString() {
|
||||||
return string(tmpstr);
|
return string(tmpstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
|
||||||
string FbTk::Resource<long>::
|
|
||||||
getString() {
|
|
||||||
char tmpstr[128];
|
|
||||||
sprintf(tmpstr, "%ld", m_value);
|
|
||||||
return string(tmpstr);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
void FbTk::Resource<Fluxbox::Layer>::
|
void FbTk::Resource<Fluxbox::Layer>::
|
||||||
setFromString(const char *strval) {
|
setFromString(const char *strval) {
|
||||||
|
@ -322,6 +307,20 @@ getString() {
|
||||||
return string(tmpstr);
|
return string(tmpstr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
template<>
|
||||||
|
void FbTk::Resource<long>::
|
||||||
|
setFromString(const char *strval) {
|
||||||
|
if (sscanf(strval, "%ld", &m_value) != 1)
|
||||||
|
setDefaultValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string FbTk::Resource<long>::
|
||||||
|
getString() {
|
||||||
|
char tmpstr[128];
|
||||||
|
sprintf(tmpstr, "%ld", m_value);
|
||||||
|
return string(tmpstr);
|
||||||
|
}
|
||||||
|
|
||||||
static Window last_bad_window = None;
|
static Window last_bad_window = None;
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -393,11 +392,12 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
|
||||||
m_rc_cache_life(m_resourcemanager, 5, "session.cacheLife", "Session.CacheLife"),
|
m_rc_cache_life(m_resourcemanager, 5, "session.cacheLife", "Session.CacheLife"),
|
||||||
m_rc_cache_max(m_resourcemanager, 200, "session.cacheMax", "Session.CacheMax"),
|
m_rc_cache_max(m_resourcemanager, 200, "session.cacheMax", "Session.CacheMax"),
|
||||||
m_rc_auto_raise_delay(m_resourcemanager, 250, "session.autoRaiseDelay", "Session.AutoRaiseDelay"),
|
m_rc_auto_raise_delay(m_resourcemanager, 250, "session.autoRaiseDelay", "Session.AutoRaiseDelay"),
|
||||||
m_focused_window(0),
|
m_focused_window(0), m_masked_window(0),
|
||||||
m_mousescreen(0),
|
m_mousescreen(0),
|
||||||
m_keyscreen(0),
|
m_keyscreen(0),
|
||||||
m_watching_screen(0), m_watch_keyrelease(0),
|
m_watching_screen(0), m_watch_keyrelease(0),
|
||||||
m_last_time(0),
|
m_last_time(0),
|
||||||
|
m_masked(0),
|
||||||
m_rc_file(rcfilename ? rcfilename : ""),
|
m_rc_file(rcfilename ? rcfilename : ""),
|
||||||
m_argv(argv), m_argc(argc),
|
m_argv(argv), m_argc(argc),
|
||||||
m_starting(true),
|
m_starting(true),
|
||||||
|
@ -405,9 +405,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
|
||||||
m_server_grabs(0),
|
m_server_grabs(0),
|
||||||
m_randr_event_type(0),
|
m_randr_event_type(0),
|
||||||
m_RC_PATH("fluxbox"),
|
m_RC_PATH("fluxbox"),
|
||||||
m_RC_INIT_FILE("init"),
|
m_RC_INIT_FILE("init") {
|
||||||
m_focus_revert_screen(0)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
if (s_singleton != 0)
|
if (s_singleton != 0)
|
||||||
|
@ -552,7 +550,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
|
||||||
m_atomhandler[atomh]->initForScreen(*screen);
|
m_atomhandler[atomh]->initForScreen(*screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
revertFocus(*screen, false); // make sure focus style is correct
|
revertFocus(*screen); // make sure focus style is correct
|
||||||
|
|
||||||
} // end init screens
|
} // end init screens
|
||||||
|
|
||||||
|
@ -624,10 +622,6 @@ void Fluxbox::eventLoop() {
|
||||||
} else {
|
} else {
|
||||||
last_bad_window = None;
|
last_bad_window = None;
|
||||||
handleEvent(&e);
|
handleEvent(&e);
|
||||||
if (m_focus_revert_screen != 0) {
|
|
||||||
revertFocus(*m_focus_revert_screen, false);
|
|
||||||
m_focus_revert_screen = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
FbTk::Timer::updateTimers(ConnectionNumber(disp)); //handle all timers
|
FbTk::Timer::updateTimers(ConnectionNumber(disp)); //handle all timers
|
||||||
|
@ -718,51 +712,17 @@ void Fluxbox::handleEvent(XEvent * const e) {
|
||||||
m_last_event = *e;
|
m_last_event = *e;
|
||||||
|
|
||||||
// it is possible (e.g. during moving) for a window
|
// it is possible (e.g. during moving) for a window
|
||||||
// to mask certain events to go somewhere (e.g. to that window)
|
// to mask all events to go to it
|
||||||
if (!m_redirect_events.empty()) {
|
if ((m_masked == e->xany.window) && m_masked_window) {
|
||||||
|
if (e->type == MotionNotify) {
|
||||||
bool drop_event = false;
|
m_last_time = e->xmotion.time;
|
||||||
RedirectEvents::iterator it = m_redirect_events.begin();
|
m_masked_window->motionNotifyEvent(e->xmotion);
|
||||||
RedirectEvents::iterator it_end = m_redirect_events.end();
|
|
||||||
RedirectEvent *re = 0;
|
|
||||||
bool matched = false;
|
|
||||||
Window orig_win = e->xany.window;
|
|
||||||
|
|
||||||
// look through all registered redirects
|
|
||||||
while (it != it_end) {
|
|
||||||
matched = false;
|
|
||||||
re = *it;
|
|
||||||
// do we affect this event?
|
|
||||||
if (e->type == re->catch_type &&
|
|
||||||
(re->catch_win == None ||
|
|
||||||
re->catch_win == orig_win)) {
|
|
||||||
matched = true;
|
|
||||||
// redirect?
|
|
||||||
if (re->redirect_win != None) {
|
|
||||||
e->xany.window = re->redirect_win;
|
|
||||||
} else {
|
|
||||||
drop_event = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// does this event stop this redirect?
|
|
||||||
if (e->type == re->stop_type &&
|
|
||||||
((re->stop_win == None && matched) ||
|
|
||||||
re->stop_win == orig_win)) {
|
|
||||||
RedirectEvents::iterator next_it = it;
|
|
||||||
++next_it;
|
|
||||||
delete (*it);
|
|
||||||
m_redirect_events.erase(it);
|
|
||||||
it = next_it;
|
|
||||||
} else
|
|
||||||
++it;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if one of the redirects says to drop it, we do
|
|
||||||
if (drop_event)
|
|
||||||
return;
|
return;
|
||||||
|
} else if (e->type == ButtonRelease) {
|
||||||
|
e->xbutton.window = m_masked_window->fbWindow().window();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// update key/mouse screen and last time before we enter other eventhandlers
|
// update key/mouse screen and last time before we enter other eventhandlers
|
||||||
if (e->type == KeyPress ||
|
if (e->type == KeyPress ||
|
||||||
|
@ -1211,7 +1171,7 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) {
|
||||||
if (m_watching_screen && m_watch_keyrelease) {
|
if (m_watching_screen && m_watch_keyrelease) {
|
||||||
// mask the mod of the released key out
|
// mask the mod of the released key out
|
||||||
// won't mask anything if it isn't a mod
|
// won't mask anything if it isn't a mod
|
||||||
ke.state &= ~FbTk::KeyUtil::keycodeToModmask(ke.keycode);
|
ke.state &= ~FbTk::KeyUtil::instance().keycodeToModmask(ke.keycode);
|
||||||
|
|
||||||
if ((m_watch_keyrelease & ke.state) == 0) {
|
if ((m_watch_keyrelease & ke.state) == 0) {
|
||||||
|
|
||||||
|
@ -1628,6 +1588,7 @@ void Fluxbox::load_rc() {
|
||||||
else // expand tilde
|
else // expand tilde
|
||||||
*m_rc_stylefile = StringUtil::expandFilename(*m_rc_stylefile);
|
*m_rc_stylefile = StringUtil::expandFilename(*m_rc_stylefile);
|
||||||
|
|
||||||
|
|
||||||
// expand tilde
|
// expand tilde
|
||||||
*m_rc_groupfile = StringUtil::expandFilename(*m_rc_groupfile);
|
*m_rc_groupfile = StringUtil::expandFilename(*m_rc_groupfile);
|
||||||
|
|
||||||
|
@ -1934,35 +1895,15 @@ void Fluxbox::setFocusedWindow(WinClient *client) {
|
||||||
* ignore_event means that it ignores the given event until
|
* ignore_event means that it ignores the given event until
|
||||||
* it gets a focusIn
|
* it gets a focusIn
|
||||||
*/
|
*/
|
||||||
void Fluxbox::revertFocus(BScreen &screen, bool wait_for_end) {
|
void Fluxbox::revertFocus(BScreen &screen) {
|
||||||
// Relevant resources:
|
// Relevant resources:
|
||||||
// resource.focus_last = whether we focus last focused when changing workspace
|
// resource.focus_last = whether we focus last focused when changing workspace
|
||||||
// BScreen::FocusModel = sloppy, click, whatever
|
// BScreen::FocusModel = sloppy, click, whatever
|
||||||
if (wait_for_end) {
|
WinClient *next_focus = screen.getLastFocusedWindow(screen.currentWorkspaceID());
|
||||||
if (m_focus_revert_screen == 0) {
|
|
||||||
m_focus_revert_screen = &screen;
|
|
||||||
return;
|
|
||||||
} else if (m_focus_revert_screen == &screen)
|
|
||||||
return;
|
|
||||||
else
|
|
||||||
cerr<<"Unexpected screen in revertFocus()"<<endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
WinClient *next_focus = 0;
|
|
||||||
long ignore_event = 0;
|
|
||||||
if (screen.doFocusLast()) {
|
|
||||||
next_focus = screen.getLastFocusedWindow(screen.currentWorkspaceID());
|
|
||||||
|
|
||||||
// when doFocusLast is set, we don't do exact sloppy focus - we
|
|
||||||
// go to the last focused window, rather than the pointer window
|
|
||||||
// i.e. we ignore any EnterNotify events until the focus sending arrives
|
|
||||||
if (screen.getFocusModel() != BScreen::CLICKTOFOCUS)
|
|
||||||
ignore_event = EnterNotify;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if setting focus fails, or isn't possible, fallback correctly
|
// if setting focus fails, or isn't possible, fallback correctly
|
||||||
if (!(next_focus && next_focus->fbwindow() &&
|
if (!(next_focus && next_focus->fbwindow() &&
|
||||||
next_focus->fbwindow()->setCurrentClient(*next_focus, true, ignore_event))) {
|
next_focus->fbwindow()->setCurrentClient(*next_focus, true))) {
|
||||||
setFocusedWindow(0); // so we don't get dangling m_focused_window pointer
|
setFocusedWindow(0); // so we don't get dangling m_focused_window pointer
|
||||||
switch (screen.getFocusModel()) {
|
switch (screen.getFocusModel()) {
|
||||||
case BScreen::SLOPPYFOCUS:
|
case BScreen::SLOPPYFOCUS:
|
||||||
|
@ -1990,42 +1931,3 @@ void Fluxbox::watchKeyRelease(BScreen &screen, unsigned int mods) {
|
||||||
screen.rootWindow().window(), True,
|
screen.rootWindow().window(), True,
|
||||||
GrabModeAsync, GrabModeAsync, CurrentTime);
|
GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Allows people to create special event exclusions/redirects
|
|
||||||
* useful for getting around X followup events, or for
|
|
||||||
* effectively grabbing things
|
|
||||||
* The ignore is automatically removed when it finds the wakeup_win
|
|
||||||
* with an event matching the wakeup_mask
|
|
||||||
* ignore None means all windows
|
|
||||||
*/
|
|
||||||
void Fluxbox::addRedirectEvent(BScreen *screen,
|
|
||||||
long catch_type, Window catch_win,
|
|
||||||
long stop_type, Window stop_win,
|
|
||||||
Window redirect_win) {
|
|
||||||
RedirectEvent * re = new RedirectEvent();
|
|
||||||
re->screen = screen;
|
|
||||||
re->catch_type = catch_type;
|
|
||||||
re->catch_win = catch_win;
|
|
||||||
re->stop_type = stop_type;
|
|
||||||
re->stop_win = stop_win;
|
|
||||||
re->redirect_win = redirect_win;
|
|
||||||
|
|
||||||
m_redirect_events.push_back(re);
|
|
||||||
}
|
|
||||||
|
|
||||||
// So that an object may remove the ignore on its own
|
|
||||||
// stop_type of None means remove all redirects for this window
|
|
||||||
void Fluxbox::removeRedirectEvent(long stop_type, Window stop_win) {
|
|
||||||
RedirectEvents::iterator it = m_redirect_events.begin();
|
|
||||||
RedirectEvents::iterator it_end = m_redirect_events.end();
|
|
||||||
RedirectEvent *re = 0;
|
|
||||||
for (; it != it_end; ++it) {
|
|
||||||
re = *it;
|
|
||||||
if (re->stop_win == stop_win && (stop_type == None || stop_type == re->stop_type)) {
|
|
||||||
m_redirect_events.erase(it);
|
|
||||||
delete re;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: fluxbox.hh,v 1.79 2003/12/21 23:24:25 fluxgen Exp $
|
// $Id: fluxbox.hh,v 1.80 2003/12/30 20:56:40 fluxgen Exp $
|
||||||
|
|
||||||
#ifndef FLUXBOX_HH
|
#ifndef FLUXBOX_HH
|
||||||
#define FLUXBOX_HH
|
#define FLUXBOX_HH
|
||||||
|
@ -149,11 +149,13 @@ public:
|
||||||
inline unsigned int getCacheLife() const { return *m_rc_cache_life * 60000; }
|
inline unsigned int getCacheLife() const { return *m_rc_cache_life * 60000; }
|
||||||
inline unsigned int getCacheMax() const { return *m_rc_cache_max; }
|
inline unsigned int getCacheMax() const { return *m_rc_cache_max; }
|
||||||
|
|
||||||
|
inline void maskWindowEvents(Window w, FluxboxWindow *bw)
|
||||||
|
{ m_masked = w; m_masked_window = bw; }
|
||||||
|
|
||||||
void watchKeyRelease(BScreen &screen, unsigned int mods);
|
void watchKeyRelease(BScreen &screen, unsigned int mods);
|
||||||
|
|
||||||
void setFocusedWindow(WinClient *w);
|
void setFocusedWindow(WinClient *w);
|
||||||
// focus revert gets delayed until the end of the event handle
|
void revertFocus(BScreen &screen);
|
||||||
void revertFocus(BScreen &screen, bool wait_for_end = true);
|
|
||||||
void shutdown();
|
void shutdown();
|
||||||
void load_rc(BScreen &scr);
|
void load_rc(BScreen &scr);
|
||||||
void loadRootCommand(BScreen &scr);
|
void loadRootCommand(BScreen &scr);
|
||||||
|
@ -202,21 +204,6 @@ public:
|
||||||
// screen we are watching for modifier changes
|
// screen we are watching for modifier changes
|
||||||
BScreen *watchingScreen() { return m_watching_screen; }
|
BScreen *watchingScreen() { return m_watching_screen; }
|
||||||
const XEvent &lastEvent() const { return m_last_event; }
|
const XEvent &lastEvent() const { return m_last_event; }
|
||||||
|
|
||||||
/**
|
|
||||||
* Allows people to create special event exclusions/redirects
|
|
||||||
* useful for getting around X followup events, or for
|
|
||||||
* effectively grabbing things
|
|
||||||
* The ignore is automatically removed when it finds the stop_win
|
|
||||||
* with an event matching the stop_type
|
|
||||||
* ignore None means all windows
|
|
||||||
*/
|
|
||||||
void addRedirectEvent(BScreen *screen, long catch_type, Window catch_win,
|
|
||||||
long stop_type, Window stop_win, Window redirect_win);
|
|
||||||
|
|
||||||
// So that an object may remove the ignore on its own
|
|
||||||
void removeRedirectEvent(long stop_type, Window stop_win);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
typedef struct MenuTimestamp {
|
typedef struct MenuTimestamp {
|
||||||
|
@ -260,7 +247,6 @@ private:
|
||||||
FbTk::Resource<unsigned int> m_rc_cache_life, m_rc_cache_max;
|
FbTk::Resource<unsigned int> m_rc_cache_life, m_rc_cache_max;
|
||||||
FbTk::Resource<time_t> m_rc_auto_raise_delay;
|
FbTk::Resource<time_t> m_rc_auto_raise_delay;
|
||||||
|
|
||||||
|
|
||||||
std::map<Window, WinClient *> m_window_search;
|
std::map<Window, WinClient *> m_window_search;
|
||||||
std::map<Window, FluxboxWindow *> m_window_search_group;
|
std::map<Window, FluxboxWindow *> m_window_search_group;
|
||||||
// A window is the group leader, which can map to several
|
// A window is the group leader, which can map to several
|
||||||
|
@ -275,19 +261,8 @@ private:
|
||||||
ScreenList m_screen_list;
|
ScreenList m_screen_list;
|
||||||
|
|
||||||
WinClient *m_focused_window;
|
WinClient *m_focused_window;
|
||||||
|
FluxboxWindow *m_masked_window;
|
||||||
|
|
||||||
typedef struct RedirectEvent {
|
|
||||||
BScreen *screen;
|
|
||||||
long catch_type;
|
|
||||||
Window catch_win;
|
|
||||||
long stop_type;
|
|
||||||
Window stop_win;
|
|
||||||
Window redirect_win;
|
|
||||||
} RedirectEvent;
|
|
||||||
|
|
||||||
typedef std::list<RedirectEvent *> RedirectEvents;
|
|
||||||
|
|
||||||
RedirectEvents m_redirect_events;
|
|
||||||
BScreen *m_mousescreen, *m_keyscreen;
|
BScreen *m_mousescreen, *m_keyscreen;
|
||||||
BScreen *m_watching_screen;
|
BScreen *m_watching_screen;
|
||||||
unsigned int m_watch_keyrelease;
|
unsigned int m_watch_keyrelease;
|
||||||
|
@ -296,6 +271,7 @@ private:
|
||||||
|
|
||||||
bool m_reconfigure_wait, m_reread_menu_wait;
|
bool m_reconfigure_wait, m_reread_menu_wait;
|
||||||
Time m_last_time;
|
Time m_last_time;
|
||||||
|
Window m_masked;
|
||||||
std::string m_rc_file; ///< resource filename
|
std::string m_rc_file; ///< resource filename
|
||||||
char **m_argv;
|
char **m_argv;
|
||||||
int m_argc;
|
int m_argc;
|
||||||
|
@ -320,9 +296,6 @@ private:
|
||||||
const char *m_RC_PATH;
|
const char *m_RC_PATH;
|
||||||
const char *m_RC_INIT_FILE;
|
const char *m_RC_INIT_FILE;
|
||||||
Atom m_kwm1_dockwindow, m_kwm2_dockwindow;
|
Atom m_kwm1_dockwindow, m_kwm2_dockwindow;
|
||||||
|
|
||||||
// each event can only affect one screen (right?)
|
|
||||||
BScreen *m_focus_revert_screen;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue