mirror of
https://github.com/Trensa-Organization/hy3.git
synced 2025-03-15 18:53:40 +01:00
pull: Added some good pull requests
This commit is contained in:
parent
4db9b1f37a
commit
da91c54ef4
4 changed files with 21 additions and 4 deletions
|
@ -181,6 +181,9 @@ plugin {
|
||||||
# offset from group split direction when only one window is in a group
|
# offset from group split direction when only one window is in a group
|
||||||
group_inset = <int> # default: 10
|
group_inset = <int> # default: 10
|
||||||
|
|
||||||
|
# scale factor of windows on the special workspace
|
||||||
|
special_scale_factor = <float> # default: 0.8
|
||||||
|
|
||||||
# if a tab group will automatically be created for the first window spawned in a workspace
|
# if a tab group will automatically be created for the first window spawned in a workspace
|
||||||
tab_first_window = <bool>
|
tab_first_window = <bool>
|
||||||
|
|
||||||
|
|
|
@ -95,8 +95,11 @@ void Hy3Layout::onWindowCreatedTiling(CWindow* window, eDirection) {
|
||||||
Hy3Node* opening_into;
|
Hy3Node* opening_into;
|
||||||
Hy3Node* opening_after = nullptr;
|
Hy3Node* opening_after = nullptr;
|
||||||
|
|
||||||
if (monitor->activeWorkspace != -1) {
|
int specialWorkspaceID = monitor->specialWorkspaceID;
|
||||||
auto* root = this->getWorkspaceRootGroup(monitor->activeWorkspace);
|
int workspace_id = specialWorkspaceID ? specialWorkspaceID : monitor->activeWorkspace;
|
||||||
|
|
||||||
|
if (workspace_id != -1) {
|
||||||
|
auto* root = this->getWorkspaceRootGroup(workspace_id);
|
||||||
|
|
||||||
if (root != nullptr) {
|
if (root != nullptr) {
|
||||||
opening_after = root->getFocusedNode();
|
opening_after = root->getFocusedNode();
|
||||||
|
@ -1390,7 +1393,7 @@ void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool no_animation) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (monitor == nullptr) {
|
if (!g_pCompositor->isWorkspaceSpecial(node->workspace_id) && monitor == nullptr) {
|
||||||
hy3_log(
|
hy3_log(
|
||||||
ERR,
|
ERR,
|
||||||
"node {:x}'s workspace has no associated monitor, cannot apply node data",
|
"node {:x}'s workspace has no associated monitor, cannot apply node data",
|
||||||
|
@ -1462,6 +1465,14 @@ void Hy3Layout::applyNodeDataToWindow(Hy3Node* node, bool no_animation) {
|
||||||
calcPos = calcPos + reserved_area.topLeft;
|
calcPos = calcPos + reserved_area.topLeft;
|
||||||
calcSize = calcSize - (reserved_area.topLeft - reserved_area.bottomRight);
|
calcSize = calcSize - (reserved_area.topLeft - reserved_area.bottomRight);
|
||||||
|
|
||||||
|
if (g_pCompositor->isWorkspaceSpecial(window->m_iWorkspaceID)) {
|
||||||
|
// adjust for special workspaces
|
||||||
|
static const auto* scalefactor
|
||||||
|
= &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:special_scale_factor")->floatValue;
|
||||||
|
calcPos = calcPos + (calcSize - calcSize * *scalefactor) / 2.f;
|
||||||
|
calcSize = calcSize * *scalefactor;
|
||||||
|
}
|
||||||
|
|
||||||
CBox wb = {calcPos, calcSize};
|
CBox wb = {calcPos, calcSize};
|
||||||
wb.round();
|
wb.round();
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,9 @@
|
||||||
int workspace_for_action() {
|
int workspace_for_action() {
|
||||||
if (g_pLayoutManager->getCurrentLayout() != g_Hy3Layout.get()) return -1;
|
if (g_pLayoutManager->getCurrentLayout() != g_Hy3Layout.get()) return -1;
|
||||||
|
|
||||||
int workspace_id = g_pCompositor->m_pLastMonitor->activeWorkspace;
|
int specialWorkspaceID = g_pCompositor->m_pLastMonitor->specialWorkspaceID;
|
||||||
|
int workspace_id
|
||||||
|
= specialWorkspaceID ? specialWorkspaceID : g_pCompositor->m_pLastMonitor->activeWorkspace;
|
||||||
|
|
||||||
if (workspace_id == -1) return -1;
|
if (workspace_id == -1) return -1;
|
||||||
auto* workspace = g_pCompositor->getWorkspaceByID(workspace_id);
|
auto* workspace = g_pCompositor->getWorkspaceByID(workspace_id);
|
||||||
|
|
|
@ -21,6 +21,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
|
||||||
CONF("no_gaps_when_only", int, 0);
|
CONF("no_gaps_when_only", int, 0);
|
||||||
CONF("node_collapse_policy", int, 2);
|
CONF("node_collapse_policy", int, 2);
|
||||||
CONF("group_inset", int, 10);
|
CONF("group_inset", int, 10);
|
||||||
|
CONF("special_scale_factor", float, 0.8);
|
||||||
CONF("tab_first_window", int, 0);
|
CONF("tab_first_window", int, 0);
|
||||||
|
|
||||||
// tabs
|
// tabs
|
||||||
|
|
Loading…
Add table
Reference in a new issue