mirror of
https://github.com/hyprwm/Hypr.git
synced 2025-02-17 00:22:06 +01:00
fix rare crash in the bar
This commit is contained in:
parent
1fd1e09dbc
commit
029c66b2bc
2 changed files with 3 additions and 3 deletions
|
@ -134,7 +134,7 @@ void CStatusBar::draw() {
|
||||||
|
|
||||||
const auto WORKSPACE = g_pWindowManager->getWorkspaceByID(g_pWindowManager->activeWorkspaces[m_iMonitorID]);
|
const auto WORKSPACE = g_pWindowManager->getWorkspaceByID(g_pWindowManager->activeWorkspaces[m_iMonitorID]);
|
||||||
|
|
||||||
if (WORKSPACE->getHasFullscreenWindow()) // TODO: fix this
|
if (!WORKSPACE || WORKSPACE->getHasFullscreenWindow()) // TODO: fix this
|
||||||
return; // Do not draw a bar on a fullscreen window.
|
return; // Do not draw a bar on a fullscreen window.
|
||||||
|
|
||||||
xcb_rectangle_t rectangles[] = {{(int)0, (int)0, (int)m_vecSize.x, (int)m_vecSize.y}};
|
xcb_rectangle_t rectangles[] = {{(int)0, (int)0, (int)m_vecSize.x, (int)m_vecSize.y}};
|
||||||
|
|
|
@ -130,11 +130,11 @@ void CWindowManager::setupRandrMonitors() {
|
||||||
void CWindowManager::setupManager() {
|
void CWindowManager::setupManager() {
|
||||||
setupRandrMonitors();
|
setupRandrMonitors();
|
||||||
|
|
||||||
if (monitors.size() == 0) {
|
if (1 || monitors.size() == 0) {
|
||||||
// RandR failed!
|
// RandR failed!
|
||||||
Debug::log(WARN, "RandR failed!");
|
Debug::log(WARN, "RandR failed!");
|
||||||
|
|
||||||
#define TESTING_MON_AMOUNT 1
|
#define TESTING_MON_AMOUNT 3
|
||||||
for (int i = 0; i < TESTING_MON_AMOUNT /* Testing on 3 monitors, RandR shouldnt fail on a real desktop */; ++i) {
|
for (int i = 0; i < TESTING_MON_AMOUNT /* Testing on 3 monitors, RandR shouldnt fail on a real desktop */; ++i) {
|
||||||
monitors.push_back(SMonitor());
|
monitors.push_back(SMonitor());
|
||||||
monitors[i].vecPosition = Vector2D(i * Screen->width_in_pixels / TESTING_MON_AMOUNT, 0);
|
monitors[i].vecPosition = Vector2D(i * Screen->width_in_pixels / TESTING_MON_AMOUNT, 0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue