mirror of
https://github.com/Trensa-Organization/hy3.git
synced 2025-03-15 10:43:40 +01:00
layout: fix maximize failing for workspaces with no tiled windows
This commit is contained in:
parent
5736875600
commit
160fe1dda5
3 changed files with 10 additions and 6 deletions
|
@ -1,5 +1,8 @@
|
|||
# Changelog
|
||||
|
||||
## Upcoming
|
||||
- Fixed fullscreen not working on workspaces with only floating windows
|
||||
|
||||
## hl0.36.0 and before
|
||||
|
||||
- Implement `resizeactivewindow` for floating windows
|
||||
|
|
|
@ -1092,7 +1092,9 @@ Hy3Node* findTabBarAt(Hy3Node& node, Vector2D pos, Hy3Node** focused_node) {
|
|||
for (auto& tab: tab_bar.bar.entries) {
|
||||
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;
|
||||
return &node;
|
||||
}
|
||||
|
@ -1448,7 +1450,6 @@ void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool no_animation) {
|
|||
if (node->data.type != Hy3NodeType::Window) return;
|
||||
auto* window = node->data.as_window;
|
||||
auto root_node = this->getWorkspaceRootGroup(window->m_iWorkspaceID);
|
||||
if (root_node == nullptr) return;
|
||||
|
||||
CMonitor* monitor = nullptr;
|
||||
|
||||
|
@ -1496,7 +1497,7 @@ void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool no_animation) {
|
|||
window->m_vSize = node->size;
|
||||
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;
|
||||
|
||||
if (!g_pCompositor->isWorkspaceSpecial(window->m_iWorkspaceID)
|
||||
|
|
|
@ -390,7 +390,7 @@ void Hy3TabBar::updateAnimations(bool warp) {
|
|||
while (entry != this->entries.end()) {
|
||||
if (warp) {
|
||||
if (entry->width.goal() == 0.0) {
|
||||
//this->entries.erase(entry++);
|
||||
// this->entries.erase(entry++);
|
||||
entry = std::next(entry);
|
||||
continue;
|
||||
}
|
||||
|
@ -605,8 +605,8 @@ void Hy3TabGroup::renderTabBar() {
|
|||
Vector2D entry_pos = {
|
||||
(pos.x + (entry.offset.value() * size.x) + (*padding * 0.5)) * scale,
|
||||
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};
|
||||
if (entry_size.x < 0 || entry_size.y < 0 || fade_opacity == 0.0) return;
|
||||
|
|
Loading…
Add table
Reference in a new issue