summaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/root.c4
-rw-r--r--sway/tree/view.c7
2 files changed, 9 insertions, 2 deletions
diff --git a/sway/tree/root.c b/sway/tree/root.c
index e5eb8f2a..9bda7c28 100644
--- a/sway/tree/root.c
+++ b/sway/tree/root.c
@@ -59,13 +59,13 @@ void root_scratchpad_add_container(struct sway_container *con) {
if (!sway_assert(!con->scratchpad, "Container is already in scratchpad")) {
return;
}
- con->scratchpad = true;
- list_add(root->scratchpad, con);
struct sway_container *parent = con->parent;
struct sway_workspace *workspace = con->workspace;
container_set_floating(con, true);
container_detach(con);
+ con->scratchpad = true;
+ list_add(root->scratchpad, con);
struct sway_seat *seat = input_manager_current_seat();
if (parent) {
diff --git a/sway/tree/view.c b/sway/tree/view.c
index a8486dd7..20babf7b 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -116,6 +116,13 @@ uint32_t view_get_x11_window_id(struct sway_view *view) {
}
return 0;
}
+
+uint32_t view_get_x11_parent_id(struct sway_view *view) {
+ if (view->impl->get_int_prop) {
+ return view->impl->get_int_prop(view, VIEW_PROP_X11_PARENT_ID);
+ }
+ return 0;
+}
#endif
const char *view_get_window_role(struct sway_view *view) {
if (view->impl->get_string_prop) {