mirror of
https://github.com/hyprwm/Hypr.git
synced 2024-12-24 18:39:47 +01:00
Fixed #32
This commit is contained in:
parent
8512fc63cc
commit
14c76ac03f
2 changed files with 13 additions and 4 deletions
|
@ -507,9 +507,9 @@ CWindow* Events::remapWindow(int windowID, bool wasfloating, int forcemonitor) {
|
|||
if (auto PLASTWINDOW = g_pWindowManager->getWindowFromDrawable(g_pWindowManager->LastWindow); (PLASTWINDOW && PLASTWINDOW->getWorkspaceID() == g_pWindowManager->activeWorkspaces[CURRENTSCREEN]) || wasfloating || (forcemonitor != -1 && forcemonitor != PMONITOR->ID)) {
|
||||
// LastWindow is on our workspace, let's make a new split node
|
||||
|
||||
if (wasfloating || (forcemonitor != -1 && forcemonitor != PMONITOR->ID) || PLASTWINDOW->getIsFloating()) {
|
||||
if (wasfloating || (forcemonitor != -1 && forcemonitor != PMONITOR->ID) || (forcemonitor != -1 && PLASTWINDOW->getWorkspaceID() != g_pWindowManager->activeWorkspaces[CURRENTSCREEN]) || PLASTWINDOW->getIsFloating()) {
|
||||
// if it's force monitor, find the first on a workspace.
|
||||
if (forcemonitor != -1 && forcemonitor != PMONITOR->ID) {
|
||||
if ((forcemonitor != -1 && forcemonitor != PMONITOR->ID) || (forcemonitor != -1 && PLASTWINDOW->getWorkspaceID() != g_pWindowManager->activeWorkspaces[CURRENTSCREEN])) {
|
||||
PLASTWINDOW = g_pWindowManager->findFirstWindowOnWorkspace(g_pWindowManager->activeWorkspaces[CURRENTSCREEN]);
|
||||
} else {
|
||||
// find a window manually by the cursor
|
||||
|
|
|
@ -135,7 +135,7 @@ void CWindowManager::setupRandrMonitors() {
|
|||
|
||||
xcb_flush(DisplayConnection);
|
||||
|
||||
if (monitors.size() == 0) {
|
||||
if (monitors.size() == 0 || true) {
|
||||
// RandR failed!
|
||||
Debug::log(WARN, "RandR failed!");
|
||||
monitors.clear();
|
||||
|
@ -1350,16 +1350,25 @@ void CWindowManager::warpCursorTo(Vector2D to) {
|
|||
|
||||
void CWindowManager::moveActiveWindowToWorkspace(int workspace) {
|
||||
|
||||
const auto PWINDOW = getWindowFromDrawable(LastWindow);
|
||||
auto PWINDOW = getWindowFromDrawable(LastWindow);
|
||||
|
||||
if (!PWINDOW)
|
||||
return;
|
||||
|
||||
if (PWINDOW->getWorkspaceID() == workspace)
|
||||
return;
|
||||
|
||||
Debug::log(LOG, "Moving active window to " + std::to_string(workspace));
|
||||
|
||||
const auto SAVEDDEFAULTSIZE = PWINDOW->getDefaultSize();
|
||||
const auto SAVEDFLOATSTATUS = PWINDOW->getIsFloating();
|
||||
const auto SAVEDDRAWABLE = PWINDOW->getDrawable();
|
||||
|
||||
fixWindowOnClose(PWINDOW);
|
||||
// deque reallocated
|
||||
LastWindow = SAVEDDRAWABLE;
|
||||
PWINDOW = getWindowFromDrawable(LastWindow);
|
||||
PWINDOW->setDead(false);
|
||||
|
||||
if (const auto WORKSPACE = getWorkspaceByID(PWINDOW->getWorkspaceID()); WORKSPACE && PWINDOW->getFullscreen())
|
||||
WORKSPACE->setHasFullscreenWindow(false);
|
||||
|
|
Loading…
Reference in a new issue