mirror of
https://github.com/hyprwm/Hypr.git
synced 2024-11-22 13:35:57 +01:00
refocus when window closed
This commit is contained in:
parent
0cfe129ce4
commit
bafa001f59
3 changed files with 18 additions and 0 deletions
|
@ -79,12 +79,18 @@ void Events::eventDestroy(xcb_generic_event_t* event) {
|
|||
const auto E = reinterpret_cast<xcb_destroy_notify_event_t*>(event);
|
||||
|
||||
g_pWindowManager->closeWindowAllChecks(E->window);
|
||||
|
||||
// refocus on new window
|
||||
g_pWindowManager->refocusWindowOnClosed();
|
||||
}
|
||||
|
||||
void Events::eventUnmapWindow(xcb_generic_event_t* event) {
|
||||
const auto E = reinterpret_cast<xcb_unmap_notify_event_t*>(event);
|
||||
|
||||
g_pWindowManager->closeWindowAllChecks(E->window);
|
||||
|
||||
// refocus on new window
|
||||
g_pWindowManager->refocusWindowOnClosed();
|
||||
}
|
||||
|
||||
CWindow* Events::remapFloatingWindow(int windowID, int forcemonitor) {
|
||||
|
|
|
@ -1378,4 +1378,15 @@ void CWindowManager::getICCCMWMProtocols(CWindow* pWindow) {
|
|||
}
|
||||
|
||||
xcb_icccm_get_wm_protocols_reply_wipe(&WMProtocolsReply);
|
||||
}
|
||||
|
||||
void CWindowManager::refocusWindowOnClosed() {
|
||||
const auto PWINDOW = findWindowAtCursor();
|
||||
|
||||
if (!PWINDOW)
|
||||
return;
|
||||
|
||||
LastWindow = PWINDOW->getDrawable();
|
||||
|
||||
setFocusedWindow(PWINDOW->getDrawable());
|
||||
}
|
|
@ -67,6 +67,7 @@ public:
|
|||
void refreshDirtyWindows();
|
||||
|
||||
void setFocusedWindow(xcb_drawable_t);
|
||||
void refocusWindowOnClosed();
|
||||
|
||||
void calculateNewWindowParams(CWindow*);
|
||||
void fixWindowOnClose(CWindow*);
|
||||
|
|
Loading…
Reference in a new issue