mirror of
https://github.com/hyprwm/Hypr.git
synced 2024-11-26 14:55:58 +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);
|
const auto E = reinterpret_cast<xcb_destroy_notify_event_t*>(event);
|
||||||
|
|
||||||
g_pWindowManager->closeWindowAllChecks(E->window);
|
g_pWindowManager->closeWindowAllChecks(E->window);
|
||||||
|
|
||||||
|
// refocus on new window
|
||||||
|
g_pWindowManager->refocusWindowOnClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Events::eventUnmapWindow(xcb_generic_event_t* event) {
|
void Events::eventUnmapWindow(xcb_generic_event_t* event) {
|
||||||
const auto E = reinterpret_cast<xcb_unmap_notify_event_t*>(event);
|
const auto E = reinterpret_cast<xcb_unmap_notify_event_t*>(event);
|
||||||
|
|
||||||
g_pWindowManager->closeWindowAllChecks(E->window);
|
g_pWindowManager->closeWindowAllChecks(E->window);
|
||||||
|
|
||||||
|
// refocus on new window
|
||||||
|
g_pWindowManager->refocusWindowOnClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
CWindow* Events::remapFloatingWindow(int windowID, int forcemonitor) {
|
CWindow* Events::remapFloatingWindow(int windowID, int forcemonitor) {
|
||||||
|
|
|
@ -1379,3 +1379,14 @@ void CWindowManager::getICCCMWMProtocols(CWindow* pWindow) {
|
||||||
|
|
||||||
xcb_icccm_get_wm_protocols_reply_wipe(&WMProtocolsReply);
|
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 refreshDirtyWindows();
|
||||||
|
|
||||||
void setFocusedWindow(xcb_drawable_t);
|
void setFocusedWindow(xcb_drawable_t);
|
||||||
|
void refocusWindowOnClosed();
|
||||||
|
|
||||||
void calculateNewWindowParams(CWindow*);
|
void calculateNewWindowParams(CWindow*);
|
||||||
void fixWindowOnClose(CWindow*);
|
void fixWindowOnClose(CWindow*);
|
||||||
|
|
Loading…
Reference in a new issue