add iconifying
This commit is contained in:
parent
b94699afc3
commit
c6234a4de0
6 changed files with 17 additions and 1 deletions
|
@ -35,7 +35,7 @@ public:
|
||||||
enum ActionType {
|
enum ActionType {
|
||||||
noaction = 0,
|
noaction = 0,
|
||||||
execute,
|
execute,
|
||||||
iconify,
|
iconify, //done
|
||||||
raise, //done
|
raise, //done
|
||||||
lower, //done
|
lower, //done
|
||||||
close, //done
|
close, //done
|
||||||
|
|
|
@ -108,6 +108,10 @@ epist::epist(char **argv, char *dpy_name, char *rc_file)
|
||||||
XKeysymToKeycode(getXDisplay(),
|
XKeysymToKeycode(getXDisplay(),
|
||||||
XStringToKeysym("Down")),
|
XStringToKeysym("Down")),
|
||||||
Mod1Mask));
|
Mod1Mask));
|
||||||
|
_actions.push_back(Action(Action::iconify,
|
||||||
|
XKeysymToKeycode(getXDisplay(),
|
||||||
|
XStringToKeysym("I")),
|
||||||
|
Mod1Mask | ControlMask));
|
||||||
activateGrabs();
|
activateGrabs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -175,6 +175,10 @@ void screen::handleKeypress(const XEvent &e) {
|
||||||
XWindow *window = *_active;
|
XWindow *window = *_active;
|
||||||
|
|
||||||
switch (it->type()) {
|
switch (it->type()) {
|
||||||
|
case Action::iconify:
|
||||||
|
window->iconify();
|
||||||
|
return;
|
||||||
|
|
||||||
case Action::close:
|
case Action::close:
|
||||||
window->close();
|
window->close();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -60,6 +60,7 @@ public:
|
||||||
|
|
||||||
inline Window rootWindow() const { return _root; }
|
inline Window rootWindow() const { return _root; }
|
||||||
inline bool managed() const { return _managed; }
|
inline bool managed() const { return _managed; }
|
||||||
|
inline int number() const { return _number; }
|
||||||
|
|
||||||
void processEvent(const XEvent &e);
|
void processEvent(const XEvent &e);
|
||||||
|
|
||||||
|
|
|
@ -164,3 +164,9 @@ void XWindow::raise() const {
|
||||||
void XWindow::lower() const {
|
void XWindow::lower() const {
|
||||||
XLowerWindow(_epist->getXDisplay(), _window);
|
XLowerWindow(_epist->getXDisplay(), _window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void XWindow::iconify() const {
|
||||||
|
_xatom->sendClientMessage(_screen->rootWindow(), XAtom::wm_change_state,
|
||||||
|
_window, IconicState);
|
||||||
|
}
|
||||||
|
|
|
@ -84,6 +84,7 @@ public:
|
||||||
void close() const;
|
void close() const;
|
||||||
void raise() const;
|
void raise() const;
|
||||||
void lower() const;
|
void lower() const;
|
||||||
|
void iconify() const;
|
||||||
|
|
||||||
bool operator == (const XWindow &w) const { return w._window == _window; }
|
bool operator == (const XWindow &w) const { return w._window == _window; }
|
||||||
bool operator == (const Window &w) const { return w == _window; }
|
bool operator == (const Window &w) const { return w == _window; }
|
||||||
|
|
Loading…
Reference in a new issue