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 {
|
||||
noaction = 0,
|
||||
execute,
|
||||
iconify,
|
||||
iconify, //done
|
||||
raise, //done
|
||||
lower, //done
|
||||
close, //done
|
||||
|
|
|
@ -108,6 +108,10 @@ epist::epist(char **argv, char *dpy_name, char *rc_file)
|
|||
XKeysymToKeycode(getXDisplay(),
|
||||
XStringToKeysym("Down")),
|
||||
Mod1Mask));
|
||||
_actions.push_back(Action(Action::iconify,
|
||||
XKeysymToKeycode(getXDisplay(),
|
||||
XStringToKeysym("I")),
|
||||
Mod1Mask | ControlMask));
|
||||
activateGrabs();
|
||||
}
|
||||
|
||||
|
|
|
@ -175,6 +175,10 @@ void screen::handleKeypress(const XEvent &e) {
|
|||
XWindow *window = *_active;
|
||||
|
||||
switch (it->type()) {
|
||||
case Action::iconify:
|
||||
window->iconify();
|
||||
return;
|
||||
|
||||
case Action::close:
|
||||
window->close();
|
||||
return;
|
||||
|
|
|
@ -60,6 +60,7 @@ public:
|
|||
|
||||
inline Window rootWindow() const { return _root; }
|
||||
inline bool managed() const { return _managed; }
|
||||
inline int number() const { return _number; }
|
||||
|
||||
void processEvent(const XEvent &e);
|
||||
|
||||
|
|
|
@ -164,3 +164,9 @@ void XWindow::raise() const {
|
|||
void XWindow::lower() const {
|
||||
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 raise() const;
|
||||
void lower() const;
|
||||
void iconify() const;
|
||||
|
||||
bool operator == (const XWindow &w) const { return w._window == _window; }
|
||||
bool operator == (const Window &w) const { return w == _window; }
|
||||
|
|
Loading…
Reference in a new issue