Merge branch 'master' of fluxbox@git.fluxbox.org:fluxbox
Conflicts: ChangeLog
This commit is contained in:
commit
f2c8868724
15 changed files with 187 additions and 154 deletions
|
@ -4,6 +4,9 @@ Changes for 1.1.2
|
||||||
* Change focused window signal to use the new signal system (Henrik)
|
* Change focused window signal to use the new signal system (Henrik)
|
||||||
FbTk/Signal.hh, FocusControl.cc, FocusableList.hh/cc, Screen.hh/cc
|
FbTk/Signal.hh, FocusControl.cc, FocusableList.hh/cc, Screen.hh/cc
|
||||||
Window.hh/cc, fluxbox.hh/cc
|
Window.hh/cc, fluxbox.hh/cc
|
||||||
|
*08/09/25:
|
||||||
|
* Fixed issues with round corners on restart, #2110455 (Mark)
|
||||||
|
FbTk/Shape.cc
|
||||||
*08/09/21:
|
*08/09/21:
|
||||||
* Changed icon list signal in BScreen to use the new signal system
|
* Changed icon list signal in BScreen to use the new signal system
|
||||||
(Henrik)
|
(Henrik)
|
||||||
|
@ -22,6 +25,9 @@ Changes for 1.1.2
|
||||||
system (Henrik)
|
system (Henrik)
|
||||||
FocusableList.hh/cc, Screen.hh/cc, SendToMenu.hh/cc,
|
FocusableList.hh/cc, Screen.hh/cc, SendToMenu.hh/cc,
|
||||||
WorkspaceMenu.hh/cc, WorkspaceNameTool.hh/cc, fluxbox.hh/cc
|
WorkspaceMenu.hh/cc, WorkspaceNameTool.hh/cc, fluxbox.hh/cc
|
||||||
|
*08/09/23:
|
||||||
|
* Fix crashes when analyzing bad constructed _NET_WM_ICON data (Mathias)
|
||||||
|
(Ewmh.cc)
|
||||||
*08/09/18:
|
*08/09/18:
|
||||||
* Changed workspace count signal in BScreen to use the new signal
|
* Changed workspace count signal in BScreen to use the new signal
|
||||||
system. (Henrik)
|
system. (Henrik)
|
||||||
|
|
29
data/keys
29
data/keys
|
@ -7,20 +7,26 @@ OnDesktop Mouse3 :RootMenu
|
||||||
OnDesktop Mouse4 :PrevWorkspace
|
OnDesktop Mouse4 :PrevWorkspace
|
||||||
OnDesktop Mouse5 :NextWorkspace
|
OnDesktop Mouse5 :NextWorkspace
|
||||||
|
|
||||||
# scroll on the toolbar to change workspaces
|
# scroll on the toolbar to change current window
|
||||||
OnToolbar Mouse4 :PrevWorkspace
|
OnToolbar Mouse4 :PrevWindow {static groups} (iconhidden=no)
|
||||||
OnToolbar Mouse5 :NextWorkspace
|
OnToolbar Mouse5 :NextWindow {static groups} (iconhidden=no)
|
||||||
|
|
||||||
# alt + left/right click to move/resize a window
|
# alt + left/right click to move/resize a window
|
||||||
OnWindow Mod1 Mouse1 :MacroCmd {Raise} {Focus} {StartMoving}
|
OnWindow Mod1 Mouse1 :MacroCmd {Raise} {Focus} {StartMoving}
|
||||||
OnWindow Mod1 Mouse3 :MacroCmd {Raise} {Focus} {StartResizing NearestCorner}
|
OnWindow Mod1 Mouse3 :MacroCmd {Raise} {Focus} {StartResizing NearestCorner}
|
||||||
|
|
||||||
# middle click a window's titlebar and drag to attach windows
|
# alt + middle click to lower the window
|
||||||
OnTitlebar Mouse2 :StartTabbing
|
OnWindow Mod1 Mouse2 :Lower
|
||||||
|
|
||||||
|
# control-click a window's titlebar and drag to attach windows
|
||||||
|
OnTitlebar Control Mouse1 :StartTabbing
|
||||||
|
|
||||||
# double click on the titlebar to shade
|
# double click on the titlebar to shade
|
||||||
OnTitlebar Double Mouse1 :Shade
|
OnTitlebar Double Mouse1 :Shade
|
||||||
|
|
||||||
|
# middle click on the titlebar to lower
|
||||||
|
OnTitlebar Mouse2 :Lower
|
||||||
|
|
||||||
# right click on the titlebar for a menu of options
|
# right click on the titlebar for a menu of options
|
||||||
OnTitlebar Mouse3 :WindowMenu
|
OnTitlebar Mouse3 :WindowMenu
|
||||||
|
|
||||||
|
@ -57,6 +63,7 @@ Mod1 F2 :Exec fbrun
|
||||||
|
|
||||||
# current window commands
|
# current window commands
|
||||||
Mod1 F4 :Close
|
Mod1 F4 :Close
|
||||||
|
Mod1 F5 :Kill
|
||||||
Mod1 F9 :Minimize
|
Mod1 F9 :Minimize
|
||||||
Mod1 F10 :Maximize
|
Mod1 F10 :Maximize
|
||||||
Mod1 F11 :Fullscreen
|
Mod1 F11 :Fullscreen
|
||||||
|
@ -67,6 +74,18 @@ Mod1 space :WindowMenu
|
||||||
# exit fluxbox
|
# exit fluxbox
|
||||||
Control Mod1 Delete :Exit
|
Control Mod1 Delete :Exit
|
||||||
|
|
||||||
|
# change to previous/next workspace
|
||||||
|
Control Mod1 Left :PrevWorkspace
|
||||||
|
Control Mod1 Right :NextWorkspace
|
||||||
|
|
||||||
|
# send the current window to previous/next workspace
|
||||||
|
Mod4 Left :SendToPrevWorkspace
|
||||||
|
Mod4 Right :SendToNextWorkspace
|
||||||
|
|
||||||
|
# send the current window and follow it to previous/next workspace
|
||||||
|
Control Mod4 Left :TakeToPrevWorkspace
|
||||||
|
Control Mod4 Right :TakeToNextWorkspace
|
||||||
|
|
||||||
# change to a specific workspace
|
# change to a specific workspace
|
||||||
Control F1 :Workspace 1
|
Control F1 :Workspace 1
|
||||||
Control F2 :Workspace 2
|
Control F2 :Workspace 2
|
||||||
|
|
72
src/Ewmh.cc
72
src/Ewmh.cc
|
@ -76,16 +76,30 @@ namespace {
|
||||||
* byte being B. The first two cardinals are width, height. Data is in rows,
|
* byte being B. The first two cardinals are width, height. Data is in rows,
|
||||||
* left to right and top to bottom.
|
* left to right and top to bottom.
|
||||||
*
|
*
|
||||||
|
***
|
||||||
|
*
|
||||||
|
* NOTE: the returned data for XA_CARDINAL is long if the rfmt equals
|
||||||
|
* 32. sizeof(long) on 64bit machines is 8. to quote from
|
||||||
|
* "man XGetWindowProperty":
|
||||||
|
*
|
||||||
|
* If the returned format is 32, the property data will be stored as
|
||||||
|
* an array of longs (which in a 64-bit application will be 64-bit
|
||||||
|
* values that are padded in the upper 4 bytes).
|
||||||
|
*
|
||||||
|
* this is especially true on 64bit machines when some of the clients
|
||||||
|
* (eg: tvtime, konqueror3) have problems to feed in the right data
|
||||||
|
* into the _NET_WM_ICON property. we faced some segfaults because
|
||||||
|
* width and height were not quite right because of ignoring 64bit
|
||||||
|
* behaviour on client side.
|
||||||
|
*
|
||||||
* TODO: maybe move the pixmap-creation code to FbTk? */
|
* TODO: maybe move the pixmap-creation code to FbTk? */
|
||||||
void extractNetWmIcon(Atom net_wm_icon, WinClient& winclient) {
|
void extractNetWmIcon(Atom net_wm_icon, WinClient& winclient) {
|
||||||
|
|
||||||
typedef std::pair<int, int> Size;
|
typedef std::pair<int, int> Size;
|
||||||
typedef std::map<Size, const unsigned long*> IconContainer;
|
typedef std::map<Size, const unsigned long*> IconContainer;
|
||||||
|
|
||||||
// attention: the returned data for XA_CARDINAL is long if the rfmt equals
|
|
||||||
// 32. sizeof(long) on 64bit machines is 8.
|
|
||||||
unsigned long* raw_data = 0;
|
unsigned long* raw_data = 0;
|
||||||
long nr_icon_data = 0;
|
unsigned long nr_icon_data = 0;
|
||||||
|
|
||||||
{
|
{
|
||||||
Atom rtype;
|
Atom rtype;
|
||||||
|
@ -106,7 +120,10 @@ void extractNetWmIcon(Atom net_wm_icon, WinClient& winclient) {
|
||||||
|
|
||||||
// actually there is some data in _NET_WM_ICON
|
// actually there is some data in _NET_WM_ICON
|
||||||
nr_icon_data = nr_bytes_left / sizeof(CARD32);
|
nr_icon_data = nr_bytes_left / sizeof(CARD32);
|
||||||
|
#ifdef DEBUG
|
||||||
|
std::cerr << "extractNetWmIcon: " << winclient.title() << "\n";
|
||||||
|
std::cerr << "nr_icon_data: " << nr_icon_data << "\n";
|
||||||
|
#endif
|
||||||
// read all the icons stored in _NET_WM_ICON
|
// read all the icons stored in _NET_WM_ICON
|
||||||
if (raw_data)
|
if (raw_data)
|
||||||
XFree(raw_data);
|
XFree(raw_data);
|
||||||
|
@ -118,30 +135,57 @@ void extractNetWmIcon(Atom net_wm_icon, WinClient& winclient) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#ifdef DEBUG
|
||||||
|
std::cerr << "nr_read: " << nr_read << "|" << nr_bytes_left << "\n";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
IconContainer icon_data; // stores all available data, sorted by size (width x height)
|
IconContainer icon_data; // stores all available data, sorted by size (width x height)
|
||||||
int width;
|
unsigned long width;
|
||||||
int height;
|
unsigned long height;
|
||||||
|
|
||||||
// analyze the available icons
|
// analyze the available icons
|
||||||
long i;
|
//
|
||||||
|
// check also for invalid values coming in from "bad" applications
|
||||||
|
unsigned long i;
|
||||||
for (i = 0; i + 2 < nr_icon_data; i += width * height ) {
|
for (i = 0; i + 2 < nr_icon_data; i += width * height ) {
|
||||||
|
|
||||||
width = raw_data[i++];
|
width = raw_data[i++];
|
||||||
|
if (width >= nr_icon_data) {
|
||||||
|
#ifdef DEBUG
|
||||||
|
std::cerr << "Ewmh.cc extractNetWmIcon found strange _NET_WM_ICON width ("
|
||||||
|
<< width << ") for " << winclient.title() << "\n";
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
height = raw_data[i++];
|
height = raw_data[i++];
|
||||||
|
if (height >= nr_icon_data) {
|
||||||
|
#ifdef DEBUG
|
||||||
|
std::cerr << "Ewmh.cc extractNetWmIcon found strange _NET_WM_ICON height ("
|
||||||
|
<< height << ") for " << winclient.title() << "\n";
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// strange values stored in the NETWM_ICON
|
// strange values stored in the NETWM_ICON
|
||||||
if (width <= 0 || height <= 0 || i + width * height > nr_icon_data) {
|
if (i + width * height > nr_icon_data) {
|
||||||
std::cerr << "Ewmh.cc extractNetWmIcon found strange _NET_WM_ICON dimensions for " << winclient.title() << "\n";
|
#ifdef DEBUG
|
||||||
XFree(raw_data);
|
std::cerr << "Ewmh.cc extractNetWmIcon found strange _NET_WM_ICON dimensions ("
|
||||||
return;
|
<< width << "x" << height << ")for " << winclient.title() << "\n";
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
icon_data[Size(width, height)] = &raw_data[i];
|
icon_data[Size(width, height)] = &raw_data[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// no valid icons found at all
|
||||||
|
if (icon_data.empty()) {
|
||||||
|
XFree(raw_data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Display* dpy = FbTk::App::instance()->display();
|
Display* dpy = FbTk::App::instance()->display();
|
||||||
int scrn = winclient.screen().screenNumber();
|
int scrn = winclient.screen().screenNumber();
|
||||||
|
|
||||||
|
@ -178,8 +222,8 @@ void extractNetWmIcon(Atom net_wm_icon, WinClient& winclient) {
|
||||||
const unsigned long* src = icon_data.begin()->second;
|
const unsigned long* src = icon_data.begin()->second;
|
||||||
unsigned int rgba;
|
unsigned int rgba;
|
||||||
unsigned long pixel;
|
unsigned long pixel;
|
||||||
int x;
|
unsigned long x;
|
||||||
int y;
|
unsigned long y;
|
||||||
unsigned char r, g, b, a;
|
unsigned char r, g, b, a;
|
||||||
|
|
||||||
for (y = 0; y < height; y++) {
|
for (y = 0; y < height; y++) {
|
||||||
|
|
|
@ -56,7 +56,6 @@ public:
|
||||||
virtual void leaveNotifyEvent(XCrossingEvent &) { }
|
virtual void leaveNotifyEvent(XCrossingEvent &) { }
|
||||||
virtual void enterNotifyEvent(XCrossingEvent &) { }
|
virtual void enterNotifyEvent(XCrossingEvent &) { }
|
||||||
|
|
||||||
virtual void notifyUngrabKeyboard() { }
|
|
||||||
virtual void grabButtons() { }
|
virtual void grabButtons() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -65,25 +65,14 @@ EventHandler *EventManager::find(Window win) {
|
||||||
return m_eventhandlers[win];
|
return m_eventhandlers[win];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EventManager::grabKeyboard(EventHandler &ev, Window win) {
|
bool EventManager::grabKeyboard(Window win) {
|
||||||
if (m_grabbing_keyboard)
|
|
||||||
ungrabKeyboard();
|
|
||||||
|
|
||||||
int ret = XGrabKeyboard(App::instance()->display(), win, False,
|
int ret = XGrabKeyboard(App::instance()->display(), win, False,
|
||||||
GrabModeAsync, GrabModeAsync, CurrentTime);
|
GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||||
|
return (ret == Success);
|
||||||
if (ret == Success) {
|
|
||||||
m_grabbing_keyboard = &ev;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EventManager::ungrabKeyboard() {
|
void EventManager::ungrabKeyboard() {
|
||||||
XUngrabKeyboard(App::instance()->display(), CurrentTime);
|
XUngrabKeyboard(App::instance()->display(), CurrentTime);
|
||||||
if (m_grabbing_keyboard)
|
|
||||||
m_grabbing_keyboard->notifyUngrabKeyboard();
|
|
||||||
m_grabbing_keyboard = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Window EventManager::getEventWindow(XEvent &ev) {
|
Window EventManager::getEventWindow(XEvent &ev) {
|
||||||
|
@ -190,10 +179,14 @@ void EventManager::dispatch(Window win, XEvent &ev, bool parent) {
|
||||||
evhand->exposeEvent(ev.xexpose);
|
evhand->exposeEvent(ev.xexpose);
|
||||||
break;
|
break;
|
||||||
case EnterNotify:
|
case EnterNotify:
|
||||||
evhand->enterNotifyEvent(ev.xcrossing);
|
if (ev.xcrossing.mode != NotifyGrab &&
|
||||||
|
ev.xcrossing.mode != NotifyUngrab)
|
||||||
|
evhand->enterNotifyEvent(ev.xcrossing);
|
||||||
break;
|
break;
|
||||||
case LeaveNotify:
|
case LeaveNotify:
|
||||||
evhand->leaveNotifyEvent(ev.xcrossing);
|
if (ev.xcrossing.mode != NotifyGrab &&
|
||||||
|
ev.xcrossing.mode != NotifyUngrab)
|
||||||
|
evhand->leaveNotifyEvent(ev.xcrossing);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
evhand->handleEvent(ev);
|
evhand->handleEvent(ev);
|
||||||
|
|
|
@ -42,9 +42,8 @@ public:
|
||||||
void add(EventHandler &ev, Window win) { registerEventHandler(ev, win); }
|
void add(EventHandler &ev, Window win) { registerEventHandler(ev, win); }
|
||||||
void remove(Window win) { unregisterEventHandler(win); }
|
void remove(Window win) { unregisterEventHandler(win); }
|
||||||
|
|
||||||
bool grabKeyboard(EventHandler &ev, Window win);
|
bool grabKeyboard(Window win);
|
||||||
void ungrabKeyboard();
|
void ungrabKeyboard();
|
||||||
EventHandler *grabbingKeyboard() { return m_grabbing_keyboard; }
|
|
||||||
|
|
||||||
EventHandler *find(Window win);
|
EventHandler *find(Window win);
|
||||||
|
|
||||||
|
|
|
@ -219,6 +219,8 @@ int Menu::insert(MenuItem *item, int pos) {
|
||||||
} else {
|
} else {
|
||||||
menuitems.insert(menuitems.begin() + pos, item);
|
menuitems.insert(menuitems.begin() + pos, item);
|
||||||
fixMenuItemIndices();
|
fixMenuItemIndices();
|
||||||
|
if (m_active_index >= pos)
|
||||||
|
m_active_index++;
|
||||||
}
|
}
|
||||||
m_need_update = true; // we need to redraw the menu
|
m_need_update = true; // we need to redraw the menu
|
||||||
return menuitems.size();
|
return menuitems.size();
|
||||||
|
@ -233,7 +235,7 @@ int Menu::remove(unsigned int index) {
|
||||||
if (index >= menuitems.size()) {
|
if (index >= menuitems.size()) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
cout << "Bad index (" << index << ") given to Menu::remove()"
|
cout << "Bad index (" << index << ") given to Menu::remove()"
|
||||||
<< " -- should be between 0 and " << menuitems.size()
|
<< " -- should be between 0 and " << menuitems.size()-1
|
||||||
<< " inclusive." << endl;
|
<< " inclusive." << endl;
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -271,6 +273,9 @@ int Menu::remove(unsigned int index) {
|
||||||
else if (static_cast<unsigned int>(m_which_sub) > index)
|
else if (static_cast<unsigned int>(m_which_sub) > index)
|
||||||
m_which_sub--;
|
m_which_sub--;
|
||||||
|
|
||||||
|
if (static_cast<unsigned int>(m_active_index) > index)
|
||||||
|
m_active_index--;
|
||||||
|
|
||||||
m_need_update = true; // we need to redraw the menu
|
m_need_update = true; // we need to redraw the menu
|
||||||
|
|
||||||
return menuitems.size();
|
return menuitems.size();
|
||||||
|
@ -366,7 +371,7 @@ void Menu::enableTitle() {
|
||||||
setTitleVisibility(true);
|
setTitleVisibility(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::updateMenu(int active_index) {
|
void Menu::updateMenu() {
|
||||||
if (m_title_vis) {
|
if (m_title_vis) {
|
||||||
menu.item_w = theme()->titleFont().textWidth(menu.label,
|
menu.item_w = theme()->titleFont().textWidth(menu.label,
|
||||||
menu.label.size());
|
menu.label.size());
|
||||||
|
|
|
@ -109,7 +109,7 @@ public:
|
||||||
void setLabel(const FbString &labelstr);
|
void setLabel(const FbString &labelstr);
|
||||||
/// move menu to x,y
|
/// move menu to x,y
|
||||||
virtual void move(int x, int y);
|
virtual void move(int x, int y);
|
||||||
virtual void updateMenu(int active_index = -1);
|
virtual void updateMenu();
|
||||||
void setItemSelected(unsigned int index, bool val);
|
void setItemSelected(unsigned int index, bool val);
|
||||||
void setItemEnabled(unsigned int index, bool val);
|
void setItemEnabled(unsigned int index, bool val);
|
||||||
void setMinimumSublevels(int m) { menu.minsub = m; }
|
void setMinimumSublevels(int m) { menu.minsub = m; }
|
||||||
|
|
|
@ -56,9 +56,9 @@ Pixmap makePixmap(FbWindow &drawable, const unsigned char rows[]) {
|
||||||
Display *disp = App::instance()->display();
|
Display *disp = App::instance()->display();
|
||||||
|
|
||||||
const size_t data_size = 8 * 8;
|
const size_t data_size = 8 * 8;
|
||||||
// we use calloc here so we get consistent C alloc/free with XDestroyImage
|
// we use malloc here so we get consistent C alloc/free with XDestroyImage
|
||||||
// and no warnings in valgrind :)
|
// and no warnings in valgrind :)
|
||||||
char *data = (char *)calloc(data_size, sizeof (char));
|
char *data = (char *)malloc(data_size * sizeof (char));
|
||||||
if (data == 0)
|
if (data == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -141,6 +141,9 @@ Shape::~Shape() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Shape::initCorners(int screen_num) {
|
void Shape::initCorners(int screen_num) {
|
||||||
|
if (!m_win->window())
|
||||||
|
return;
|
||||||
|
|
||||||
if (s_corners.size() == 0)
|
if (s_corners.size() == 0)
|
||||||
s_corners.resize(ScreenCount(App::instance()->display()));
|
s_corners.resize(ScreenCount(App::instance()->display()));
|
||||||
|
|
||||||
|
|
|
@ -230,31 +230,6 @@ void TextBox::keyPressEvent(XKeyEvent &event) {
|
||||||
if ((event.state & ControlMask) == ControlMask) {
|
if ((event.state & ControlMask) == ControlMask) {
|
||||||
|
|
||||||
switch (ks) {
|
switch (ks) {
|
||||||
case XK_b:
|
|
||||||
cursorBackward();
|
|
||||||
break;
|
|
||||||
case XK_f:
|
|
||||||
cursorForward();
|
|
||||||
break;
|
|
||||||
case XK_a:
|
|
||||||
cursorHome();
|
|
||||||
break;
|
|
||||||
case XK_e:
|
|
||||||
cursorEnd();
|
|
||||||
break;
|
|
||||||
case XK_d:
|
|
||||||
deleteForward();
|
|
||||||
break;
|
|
||||||
case XK_k:
|
|
||||||
killToEnd();
|
|
||||||
break;
|
|
||||||
case XK_c:
|
|
||||||
cursorHome();
|
|
||||||
m_text = "";
|
|
||||||
m_start_pos = 0;
|
|
||||||
m_cursor_pos = 0;
|
|
||||||
m_end_pos = 0;
|
|
||||||
break;
|
|
||||||
case XK_Left: {
|
case XK_Left: {
|
||||||
unsigned int pos = findEmptySpaceLeft();
|
unsigned int pos = findEmptySpaceLeft();
|
||||||
if (pos < m_start_pos){
|
if (pos < m_start_pos){
|
||||||
|
@ -311,13 +286,6 @@ void TextBox::keyPressEvent(XKeyEvent &event) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if ((event.state & ShiftMask)== ShiftMask ||
|
|
||||||
(event.state & 0x80) == 0x80) { // shif and altgr
|
|
||||||
if (isprint(keychar[0])) {
|
|
||||||
std::string val;
|
|
||||||
val += keychar[0];
|
|
||||||
insertText(val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else { // no state
|
} else { // no state
|
||||||
|
@ -341,49 +309,46 @@ void TextBox::keyPressEvent(XKeyEvent &event) {
|
||||||
case XK_Delete:
|
case XK_Delete:
|
||||||
deleteForward();
|
deleteForward();
|
||||||
break;
|
break;
|
||||||
default:
|
case XK_KP_Insert:
|
||||||
switch (ks) {
|
keychar[0] = '0';
|
||||||
case XK_KP_Insert:
|
break;
|
||||||
keychar[0] = '0';
|
case XK_KP_End:
|
||||||
break;
|
keychar[0] = '1';
|
||||||
case XK_KP_End:
|
break;
|
||||||
keychar[0] = '1';
|
case XK_KP_Down:
|
||||||
break;
|
keychar[0] = '2';
|
||||||
case XK_KP_Down:
|
break;
|
||||||
keychar[0] = '2';
|
case XK_KP_Page_Down:
|
||||||
break;
|
keychar[0] = '3';
|
||||||
case XK_KP_Page_Down:
|
break;
|
||||||
keychar[0] = '3';
|
case XK_KP_Left:
|
||||||
break;
|
keychar[0] = '4';
|
||||||
case XK_KP_Left:
|
break;
|
||||||
keychar[0] = '4';
|
case XK_KP_Begin:
|
||||||
break;
|
keychar[0] = '5';
|
||||||
case XK_KP_Begin:
|
break;
|
||||||
keychar[0] = '5';
|
case XK_KP_Right:
|
||||||
break;
|
keychar[0] = '6';
|
||||||
case XK_KP_Right:
|
break;
|
||||||
keychar[0] = '6';
|
case XK_KP_Home:
|
||||||
break;
|
keychar[0] = '7';
|
||||||
case XK_KP_Home:
|
break;
|
||||||
keychar[0] = '7';
|
case XK_KP_Up:
|
||||||
break;
|
keychar[0] = '8';
|
||||||
case XK_KP_Up:
|
break;
|
||||||
keychar[0] = '8';
|
case XK_KP_Page_Up:
|
||||||
break;
|
keychar[0] = '9';
|
||||||
case XK_KP_Page_Up:
|
break;
|
||||||
keychar[0] = '9';
|
case XK_KP_Delete:
|
||||||
break;
|
keychar[0] = ',';
|
||||||
case XK_KP_Delete:
|
break;
|
||||||
keychar[0] = ',';
|
|
||||||
break;
|
|
||||||
};
|
|
||||||
if (isprint(keychar[0])) {
|
|
||||||
std::string val;
|
|
||||||
val += keychar[0];
|
|
||||||
insertText(val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (isprint(keychar[0])) {
|
||||||
|
std::string val;
|
||||||
|
val += keychar[0];
|
||||||
|
insertText(val);
|
||||||
|
}
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ void FocusControl::cycleFocus(const FocusableList &window_list,
|
||||||
const ClientPattern *pat, bool cycle_reverse) {
|
const ClientPattern *pat, bool cycle_reverse) {
|
||||||
|
|
||||||
if (!m_cycling_list) {
|
if (!m_cycling_list) {
|
||||||
if (&m_screen == FbTk::EventManager::instance()->grabbingKeyboard())
|
if (m_screen.isCycling())
|
||||||
// only set this when we're waiting for modifiers
|
// only set this when we're waiting for modifiers
|
||||||
m_cycling_list = &window_list;
|
m_cycling_list = &window_list;
|
||||||
m_was_iconic = 0;
|
m_was_iconic = 0;
|
||||||
|
|
11
src/Keys.cc
11
src/Keys.cc
|
@ -510,12 +510,6 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
|
||||||
// grab "None Escape" to exit keychain in the middle
|
// grab "None Escape" to exit keychain in the middle
|
||||||
unsigned int esc = FbTk::KeyUtil::getKey("Escape");
|
unsigned int esc = FbTk::KeyUtil::getKey("Escape");
|
||||||
|
|
||||||
// if focus changes, windows will get NotifyWhileGrabbed,
|
|
||||||
// which they tend to ignore
|
|
||||||
if (temp_key && type == KeyPress &&
|
|
||||||
!FbTk::EventManager::instance()->grabbingKeyboard())
|
|
||||||
XUngrabKeyboard(Fluxbox::instance()->display(), CurrentTime);
|
|
||||||
|
|
||||||
if (temp_key && !temp_key->keylist.empty()) { // emacs-style
|
if (temp_key && !temp_key->keylist.empty()) { // emacs-style
|
||||||
if (!saved_keymode)
|
if (!saved_keymode)
|
||||||
saved_keymode = m_keylist;
|
saved_keymode = m_keylist;
|
||||||
|
@ -536,6 +530,11 @@ bool Keys::doAction(int type, unsigned int mods, unsigned int key,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if focus changes, windows will get NotifyWhileGrabbed,
|
||||||
|
// which they tend to ignore
|
||||||
|
if (type == KeyPress)
|
||||||
|
XUngrabKeyboard(Fluxbox::instance()->display(), CurrentTime);
|
||||||
|
|
||||||
WinClient *old = WindowCmd<void>::client();
|
WinClient *old = WindowCmd<void>::client();
|
||||||
WindowCmd<void>::setClient(current);
|
WindowCmd<void>::setClient(current);
|
||||||
temp_key->m_command->execute();
|
temp_key->m_command->execute();
|
||||||
|
|
|
@ -292,7 +292,7 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm,
|
||||||
max_disable_move(rm, false, scrname+".maxDisableMove", altscrname+".MaxDisableMove"),
|
max_disable_move(rm, false, scrname+".maxDisableMove", altscrname+".MaxDisableMove"),
|
||||||
max_disable_resize(rm, false, scrname+".maxDisableResize", altscrname+".MaxDisableResize"),
|
max_disable_resize(rm, false, scrname+".maxDisableResize", altscrname+".MaxDisableResize"),
|
||||||
workspace_warping(rm, true, scrname+".workspacewarping", altscrname+".WorkspaceWarping"),
|
workspace_warping(rm, true, scrname+".workspacewarping", altscrname+".WorkspaceWarping"),
|
||||||
show_window_pos(rm, true, scrname+".showwindowposition", altscrname+".ShowWindowPosition"),
|
show_window_pos(rm, false, scrname+".showwindowposition", altscrname+".ShowWindowPosition"),
|
||||||
auto_raise(rm, true, scrname+".autoRaise", altscrname+".AutoRaise"),
|
auto_raise(rm, true, scrname+".autoRaise", altscrname+".AutoRaise"),
|
||||||
click_raises(rm, true, scrname+".clickRaises", altscrname+".ClickRaises"),
|
click_raises(rm, true, scrname+".clickRaises", altscrname+".ClickRaises"),
|
||||||
default_deco(rm, "NORMAL", scrname+".defaultDeco", altscrname+".DefaultDeco"),
|
default_deco(rm, "NORMAL", scrname+".defaultDeco", altscrname+".DefaultDeco"),
|
||||||
|
@ -855,19 +855,26 @@ void BScreen::propertyNotify(Atom atom) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BScreen::keyPressEvent(XKeyEvent &ke) {
|
void BScreen::keyPressEvent(XKeyEvent &ke) {
|
||||||
Fluxbox::instance()->keys()->doAction(ke.type, ke.state, ke.keycode,
|
if (Fluxbox::instance()->keys()->doAction(ke.type, ke.state, ke.keycode,
|
||||||
Keys::GLOBAL|Keys::ON_DESKTOP);
|
Keys::GLOBAL|Keys::ON_DESKTOP))
|
||||||
|
// re-grab keyboard, so we don't pass KeyRelease to clients
|
||||||
|
FbTk::EventManager::instance()->grabKeyboard(rootWindow().window());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BScreen::keyReleaseEvent(XKeyEvent &ke) {
|
void BScreen::keyReleaseEvent(XKeyEvent &ke) {
|
||||||
if (!m_cycling)
|
if (m_cycling) {
|
||||||
return;
|
unsigned int state = FbTk::KeyUtil::instance().cleanMods(ke.state);
|
||||||
|
state &= ~FbTk::KeyUtil::instance().keycodeToModmask(ke.keycode);
|
||||||
|
|
||||||
unsigned int state = FbTk::KeyUtil::instance().cleanMods(ke.state);
|
if (state) // still cycling
|
||||||
state &= ~FbTk::KeyUtil::instance().keycodeToModmask(ke.keycode);
|
return;
|
||||||
|
|
||||||
if (!state) // all modifiers were released
|
m_cycling = false;
|
||||||
FbTk::EventManager::instance()->ungrabKeyboard();
|
focusControl().stopCyclingFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
FbTk::EventManager::instance()->ungrabKeyboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BScreen::buttonPressEvent(XButtonEvent &be) {
|
void BScreen::buttonPressEvent(XButtonEvent &be) {
|
||||||
|
@ -879,11 +886,6 @@ void BScreen::buttonPressEvent(XButtonEvent &be) {
|
||||||
0, be.time);
|
0, be.time);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BScreen::notifyUngrabKeyboard() {
|
|
||||||
m_cycling = false;
|
|
||||||
focusControl().stopCyclingFocus();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BScreen::cycleFocus(int options, const ClientPattern *pat, bool reverse) {
|
void BScreen::cycleFocus(int options, const ClientPattern *pat, bool reverse) {
|
||||||
// get modifiers from event that causes this for focus order cycling
|
// get modifiers from event that causes this for focus order cycling
|
||||||
XEvent ev = Fluxbox::instance()->lastEvent();
|
XEvent ev = Fluxbox::instance()->lastEvent();
|
||||||
|
@ -895,7 +897,7 @@ void BScreen::cycleFocus(int options, const ClientPattern *pat, bool reverse) {
|
||||||
|
|
||||||
if (!m_cycling && mods) {
|
if (!m_cycling && mods) {
|
||||||
m_cycling = true;
|
m_cycling = true;
|
||||||
FbTk::EventManager::instance()->grabKeyboard(*this, rootWindow().window());
|
FbTk::EventManager::instance()->grabKeyboard(rootWindow().window());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mods == 0) // can't stacked cycle unless there is a mod to grab
|
if (mods == 0) // can't stacked cycle unless there is a mod to grab
|
||||||
|
@ -1029,10 +1031,10 @@ void BScreen::addIcon(FluxboxWindow *w) {
|
||||||
if (find(iconList().begin(), iconList().end(), w) != iconList().end())
|
if (find(iconList().begin(), iconList().end(), w) != iconList().end())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_icon_list.push_back(w);
|
iconList().push_back(w);
|
||||||
|
|
||||||
// notify listeners
|
// notify listeners
|
||||||
m_iconlist_sig.emit(*this);
|
iconListSig().emit(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1047,7 +1049,7 @@ void BScreen::removeIcon(FluxboxWindow *w) {
|
||||||
// change the iconlist
|
// change the iconlist
|
||||||
if (erase_it != m_icon_list.end()) {
|
if (erase_it != m_icon_list.end()) {
|
||||||
iconList().erase(erase_it);
|
iconList().erase(erase_it);
|
||||||
m_iconlist_sig.emit(*this);
|
iconListSig().emit(*this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1556,7 +1558,8 @@ void BScreen::removeConfigMenu(FbTk::Menu &menu) {
|
||||||
if (erase_it != m_configmenu_list.end())
|
if (erase_it != m_configmenu_list.end())
|
||||||
m_configmenu_list.erase(erase_it);
|
m_configmenu_list.erase(erase_it);
|
||||||
|
|
||||||
setupConfigmenu(*m_configmenu.get());
|
if (!isShuttingdown())
|
||||||
|
setupConfigmenu(*m_configmenu.get());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1627,12 +1630,12 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
|
||||||
cerr<<e.what()<<endl;
|
cerr<<e.what()<<endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
focus_menu->insert(new FbTk::BoolMenuItem(_FB_XTEXT(Configmenu,
|
_BOOLITEM(*focus_menu, Configmenu, AutoRaise,
|
||||||
AutoRaise,
|
"Auto Raise", "Auto Raise windows on sloppy",
|
||||||
"Auto Raise",
|
resource.auto_raise, saverc_cmd);
|
||||||
"Auto Raise windows on sloppy"),
|
_BOOLITEM(*focus_menu, Configmenu, ClickRaises,
|
||||||
resource.auto_raise,
|
"Click Raises", "Click Raises",
|
||||||
save_and_reconfigure));
|
resource.click_raises, saverc_cmd);
|
||||||
|
|
||||||
focus_menu->updateMenu();
|
focus_menu->updateMenu();
|
||||||
|
|
||||||
|
@ -1799,9 +1802,6 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
|
||||||
"Workspace Warping",
|
"Workspace Warping",
|
||||||
"Workspace Warping - dragging windows to the edge and onto the next workspace",
|
"Workspace Warping - dragging windows to the edge and onto the next workspace",
|
||||||
resource.workspace_warping, saverc_cmd);
|
resource.workspace_warping, saverc_cmd);
|
||||||
_BOOLITEM(menu, Configmenu, ClickRaises,
|
|
||||||
"Click Raises", "Click Raises",
|
|
||||||
resource.click_raises, saverc_cmd);
|
|
||||||
|
|
||||||
#undef _BOOLITEM
|
#undef _BOOLITEM
|
||||||
|
|
||||||
|
|
|
@ -237,7 +237,6 @@ public:
|
||||||
void keyPressEvent(XKeyEvent &ke);
|
void keyPressEvent(XKeyEvent &ke);
|
||||||
void keyReleaseEvent(XKeyEvent &ke);
|
void keyReleaseEvent(XKeyEvent &ke);
|
||||||
void buttonPressEvent(XButtonEvent &be);
|
void buttonPressEvent(XButtonEvent &be);
|
||||||
void notifyUngrabKeyboard();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cycles focus of windows
|
* Cycles focus of windows
|
||||||
|
@ -247,6 +246,8 @@ public:
|
||||||
*/
|
*/
|
||||||
void cycleFocus(int opts = 0, const ClientPattern *pat = 0, bool reverse = false);
|
void cycleFocus(int opts = 0, const ClientPattern *pat = 0, bool reverse = false);
|
||||||
|
|
||||||
|
bool isCycling() const { return m_cycling; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an empty menu with specified label
|
* Creates an empty menu with specified label
|
||||||
* @param label for the menu
|
* @param label for the menu
|
||||||
|
|
|
@ -80,7 +80,7 @@ void WorkspaceMenu::workspaceInfoChanged( BScreen& screen ) {
|
||||||
insert(mb_menu, workspace + IDX_AFTER_ICONS);
|
insert(mb_menu, workspace + IDX_AFTER_ICONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateMenu(-1);
|
updateMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorkspaceMenu::workspaceChanged(BScreen& screen) {
|
void WorkspaceMenu::workspaceChanged(BScreen& screen) {
|
||||||
|
@ -89,12 +89,12 @@ void WorkspaceMenu::workspaceChanged(BScreen& screen) {
|
||||||
item = find(i + IDX_AFTER_ICONS);
|
item = find(i + IDX_AFTER_ICONS);
|
||||||
if (item && item->isSelected()) {
|
if (item && item->isSelected()) {
|
||||||
setItemSelected(i + IDX_AFTER_ICONS, false);
|
setItemSelected(i + IDX_AFTER_ICONS, false);
|
||||||
updateMenu(i + IDX_AFTER_ICONS);
|
updateMenu();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setItemSelected(screen.currentWorkspace()->workspaceID() + IDX_AFTER_ICONS, true);
|
setItemSelected(screen.currentWorkspace()->workspaceID() + IDX_AFTER_ICONS, true);
|
||||||
updateMenu(screen.currentWorkspace()->workspaceID() + IDX_AFTER_ICONS);
|
updateMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorkspaceMenu::init(BScreen &screen) {
|
void WorkspaceMenu::init(BScreen &screen) {
|
||||||
|
|
Loading…
Reference in a new issue