mirror of
https://github.com/Trensa-Organization/hy3.git
synced 2025-03-15 18:53:40 +01:00
Move newly tiled windows into place in the window's workspace
Usually the window workspace differs from the monitor workspace when moving a window to a background workspace. Previously onWindowCreatedTiling acted on the monitor active workspace which caused windows to always appear at the end of the outermost node on the target workspace. Now they appear relative to the last selected node.
This commit is contained in:
parent
66ef532537
commit
06ecd58399
2 changed files with 14 additions and 14 deletions
|
@ -73,11 +73,14 @@ void Hy3Layout::onWindowCreated(CWindow* window, eDirection direction) {
|
|||
|
||||
void Hy3Layout::onWindowCreatedTiling(CWindow* window, eDirection) {
|
||||
hy3_log(
|
||||
TRACE,
|
||||
"onWindowCreatedTiling called with window {:x} (floating: {})",
|
||||
LOG,
|
||||
"onWindowCreatedTiling called with window {:x} (floating: {}, monitor: {}, workspace: {})",
|
||||
(uintptr_t) window,
|
||||
window->m_bIsFloating
|
||||
window->m_bIsFloating,
|
||||
window->m_iMonitorID,
|
||||
window->m_iWorkspaceID
|
||||
);
|
||||
|
||||
if (window->m_bIsFloating) return;
|
||||
|
||||
auto* existing = this->getNodeFromWindow(window);
|
||||
|
@ -96,8 +99,7 @@ void Hy3Layout::onWindowCreatedTiling(CWindow* window, eDirection) {
|
|||
Hy3Node* opening_into;
|
||||
Hy3Node* opening_after = nullptr;
|
||||
|
||||
if (monitor->activeWorkspace != -1) {
|
||||
auto* root = this->getWorkspaceRootGroup(monitor->activeWorkspace);
|
||||
auto* root = this->getWorkspaceRootGroup(window->m_iWorkspaceID);
|
||||
|
||||
if (root != nullptr) {
|
||||
opening_after = root->getFocusedNode();
|
||||
|
@ -108,7 +110,6 @@ void Hy3Layout::onWindowCreatedTiling(CWindow* window, eDirection) {
|
|||
opening_after->intoGroup(Hy3GroupLayout::SplitH, GroupEphemeralityOption::Standard);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (opening_after == nullptr) {
|
||||
if (g_pCompositor->m_pLastWindow != nullptr && !g_pCompositor->m_pLastWindow->m_bIsFloating
|
||||
|
|
|
@ -225,8 +225,7 @@ void Hy3TabBarEntry::prepareTexture(float scale, CBox& box) {
|
|||
PangoLayout* layout = pango_cairo_create_layout(cairo);
|
||||
pango_layout_set_text(layout, this->window_title.c_str(), -1);
|
||||
|
||||
if (*text_center)
|
||||
pango_layout_set_alignment(layout, PANGO_ALIGN_CENTER);
|
||||
if (*text_center) pango_layout_set_alignment(layout, PANGO_ALIGN_CENTER);
|
||||
|
||||
PangoFontDescription* font_desc = pango_font_description_from_string(text_font->c_str());
|
||||
pango_font_description_set_size(font_desc, *text_height * scale * PANGO_SCALE);
|
||||
|
|
Loading…
Add table
Reference in a new issue