1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
--- a/plugins/tile/tile-plugin.cpp
+++ b/plugins/tile/tile-plugin.cpp
@@ -51,6 +51,7 @@
{
private:
wf::view_matcher_t tile_by_default{"simple-tile/tile_by_default"};
+ wf::option_wrapper_t<bool> float_on_top{"simple-tile/float_on_top"};
wf::option_wrapper_t<bool> keep_fullscreen_on_adjacent{"simple-tile/keep_fullscreen_on_adjacent"};
wf::option_wrapper_t<wf::buttonbinding_t> button_move{"simple-tile/button_move"};
wf::option_wrapper_t<wf::buttonbinding_t> button_resize{"simple-tile/button_resize"};
@@ -267,11 +268,28 @@
{
detach_view(view);
wf::get_core().default_wm->tile_request(view, 0);
+ if (float_on_top && !view->has_data("wm-actions-above"))
+ {
+ wf::wm_actions_set_above_state_signal ev{view, true};
+ output->emit(&ev);
+ // wm-actions may be disabled; only claim a successful change.
+ if (view->has_data("wm-actions-above"))
+ {
+ view->store_data(std::make_unique<wf::custom_data_t>(),
+ "simple-tile-floating-above");
+ }
+ }
} else
{
attach_view(view);
}
});
+ };
+
+ wf::signal::connection_t<wf::wm_actions_above_changed_signal> on_above_changed =
+ [=] (wf::wm_actions_above_changed_signal *ev)
+ {
+ ev->view->erase_data("simple-tile-floating-above");
};
wf::activator_callback on_toggle_maximized = [=] (auto)
@@ -406,6 +424,7 @@
this->output = wo;
input_grab = std::make_unique<wf::input_grab_t>("simple-tile", output, nullptr, this, nullptr);
output->connect(&on_view_mapped);
+ output->connect(&on_above_changed);
output->connect(&on_tile_request);
output->connect(&on_fullscreen_request);
output->connect(&on_view_change_workspace);
@@ -446,6 +465,11 @@
void fini() override
{
+ for (auto view : wf::get_core().get_all_views())
+ {
+ clear_auto_floating_above(view);
+ }
+
preview_manager.reset();
fini_output_tracking();
for (auto wset : workspace_set_t::get_all())
@@ -477,6 +501,7 @@
wf::signal::connection_t<view_unmapped_signal> on_view_unmapped = [=] (wf::view_unmapped_signal *ev)
{
+ clear_auto_floating_above(ev->view);
auto toplevel = toplevel_cast(ev->view);
if (!toplevel)
{
--- a/plugins/tile/tile-wset.hpp
+++ b/plugins/tile/tile-wset.hpp
@@ -1,6 +1,8 @@
#pragma once
#include "tree.hpp"
+#include "../wm-actions/wm-actions-signals.hpp"
+#include <wayfire/output.hpp>
#include "tree-controller.hpp"
#include "wayfire/view-helpers.hpp"
#include "wayfire/txn/transaction-manager.hpp"
@@ -28,6 +30,29 @@
namespace wf
{
+// Only undo the above state that Simple Tile itself added. Manual changes
+// through wm-actions relinquish this ownership.
+inline void clear_auto_floating_above(wayfire_view view)
+{
+ if (!view->has_data("simple-tile-floating-above"))
+ {
+ return;
+ }
+
+ view->erase_data("simple-tile-floating-above");
+ if (view->has_data("wm-actions-above"))
+ {
+ if (auto output = view->get_output())
+ {
+ wf::wm_actions_set_above_state_signal ev{view, false};
+ output->emit(&ev);
+ } else
+ {
+ view->erase_data("wm-actions-above");
+ }
+ }
+}
+
/**
* When a view is moved from one output to the other, we want to keep its tiled
* status. To achieve this, we do the following:
@@ -251,6 +276,7 @@
std::unique_ptr<wf::tile::view_node_t> setup_view_tiling(wayfire_toplevel_view view, wf::point_t vp)
{
+ clear_auto_floating_above(view);
view->set_allowed_actions(VIEW_ALLOW_WS_CHANGE);
auto node = view->get_root_node();
wf::scene::readd_front(tiled_sublayer[vp.x][vp.y], node);
--- a/metadata/simple-tile.xml
+++ b/metadata/simple-tile.xml
@@ -13,6 +13,11 @@
<_short>Keep fullscreen on adjacent</_short>
<_long>Specifies whether to keep fullscreen state when changing the focus. If **true**, the next focused window will also get fullscreen. If **false**, leaves fullscreen.</_long>
<default>true</default>
+ </option>
+ <option name="float_on_top" type="bool">
+ <_short>Keep windows floated with the tiling toggle on top</_short>
+ <_long>When the tiling toggle makes a tiled window floating, keep it above ordinary windows. Retiling removes the automatic above state. Manual always-on-top changes take precedence. Requires wm-actions; newly opened floating windows are unaffected.</_long>
+ <default>false</default>
</option>
<!-- Key-bindings -->
<option name="button_move" type="button">
|