Skip to content

Commit

Permalink
Reset role when workspace is set
Browse files Browse the repository at this point in the history
  • Loading branch information
soreau committed Aug 14, 2024
1 parent 035fd0e commit 8ae10f9
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/pin-view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,22 @@ class wayfire_pin_view : public wf::plugin_interface_t
y = data["y"].get<int>();
}

view->role = view->get_data<pin_view_data>()->role;

wf::point_t nws{x, y};
if (auto toplevel = toplevel_cast(view))
{
auto vg = toplevel->get_geometry();
auto cws = output->wset()->get_view_main_workspace(toplevel);
toplevel->set_geometry(wf::geometry_t{(nws.x - cws.x) * og.width,
(nws.y - cws.y) * og.height, resize ? og.width : vg.width,
resize ? og.height : vg.height});
if (resize)
{
toplevel->set_geometry(wf::geometry_t{(nws.x - cws.x) * og.width,
(nws.y - cws.y) * og.height, og.width, og.height});
} else
{
auto vg = toplevel->get_geometry();
toplevel->set_geometry(wf::geometry_t{vg.x + (nws.x - cws.x) * og.width,
vg.y + (nws.y - cws.y) * og.height, vg.width, vg.height});
}
}
} else
{
Expand Down

0 comments on commit 8ae10f9

Please sign in to comment.