layout: fix maximize failing for workspaces with no tiled windows

This commit is contained in:
outfoxxed 2024-03-21 23:13:48 -07:00
parent 5736875600
commit 160fe1dda5
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
3 changed files with 10 additions and 6 deletions

View file

@ -1,5 +1,8 @@
# Changelog # Changelog
## Upcoming
- Fixed fullscreen not working on workspaces with only floating windows
## hl0.36.0 and before ## hl0.36.0 and before
- Implement `resizeactivewindow` for floating windows - Implement `resizeactivewindow` for floating windows

View file

@ -1092,7 +1092,9 @@ Hy3Node* findTabBarAt(Hy3Node& node, Vector2D pos, Hy3Node** focused_node) {
for (auto& tab: tab_bar.bar.entries) { for (auto& tab: tab_bar.bar.entries) {
if (child_iter == children.end()) break; if (child_iter == children.end()) break;
if (x > tab.offset.value() * size.x && x < (tab.offset.value() + tab.width.value()) * size.x) { if (x > tab.offset.value() * size.x
&& x < (tab.offset.value() + tab.width.value()) * size.x)
{
*focused_node = *child_iter; *focused_node = *child_iter;
return &node; return &node;
} }
@ -1448,7 +1450,6 @@ void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool no_animation) {
if (node->data.type != Hy3NodeType::Window) return; if (node->data.type != Hy3NodeType::Window) return;
auto* window = node->data.as_window; auto* window = node->data.as_window;
auto root_node = this->getWorkspaceRootGroup(window->m_iWorkspaceID); auto root_node = this->getWorkspaceRootGroup(window->m_iWorkspaceID);
if (root_node == nullptr) return;
CMonitor* monitor = nullptr; CMonitor* monitor = nullptr;
@ -1496,7 +1497,7 @@ void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool no_animation) {
window->m_vSize = node->size; window->m_vSize = node->size;
window->m_vPosition = node->position; window->m_vPosition = node->position;
auto only_node = root_node->data.as_group.children.size() == 1 auto only_node = root_node != nullptr && root_node->data.as_group.children.size() == 1
&& root_node->data.as_group.children.front()->data.type == Hy3NodeType::Window; && root_node->data.as_group.children.front()->data.type == Hy3NodeType::Window;
if (!g_pCompositor->isWorkspaceSpecial(window->m_iWorkspaceID) if (!g_pCompositor->isWorkspaceSpecial(window->m_iWorkspaceID)

View file

@ -390,7 +390,7 @@ void Hy3TabBar::updateAnimations(bool warp) {
while (entry != this->entries.end()) { while (entry != this->entries.end()) {
if (warp) { if (warp) {
if (entry->width.goal() == 0.0) { if (entry->width.goal() == 0.0) {
//this->entries.erase(entry++); // this->entries.erase(entry++);
entry = std::next(entry); entry = std::next(entry);
continue; continue;
} }
@ -605,8 +605,8 @@ void Hy3TabGroup::renderTabBar() {
Vector2D entry_pos = { Vector2D entry_pos = {
(pos.x + (entry.offset.value() * size.x) + (*padding * 0.5)) * scale, (pos.x + (entry.offset.value() * size.x) + (*padding * 0.5)) * scale,
scaled_pos.y scaled_pos.y
+ ((entry.vertical_pos.value() * (size.y + *padding) * scale) * (*enter_from_top ? -1 : 1) + ((entry.vertical_pos.value() * (size.y + *padding) * scale)
), * (*enter_from_top ? -1 : 1)),
}; };
Vector2D entry_size = {((entry.width.value() * size.x) - *padding) * scale, scaled_size.y}; Vector2D entry_size = {((entry.width.value() * size.x) - *padding) * scale, scaled_size.y};
if (entry_size.x < 0 || entry_size.y < 0 || fade_opacity == 0.0) return; if (entry_size.x < 0 || entry_size.y < 0 || fade_opacity == 0.0) return;