mirror of
https://github.com/swaywm/sway.git
synced 2025-11-26 06:59:59 -05:00
Merge remote-tracking branch 'upstream/master' into atomic
This commit is contained in:
commit
e396af853b
8 changed files with 68 additions and 22 deletions
|
|
@ -108,6 +108,19 @@ static void set_activated(struct sway_view *view, bool activated) {
|
|||
}
|
||||
}
|
||||
|
||||
static void set_tiled(struct sway_view *view, bool tiled) {
|
||||
if (xdg_shell_view_from_view(view) == NULL) {
|
||||
return;
|
||||
}
|
||||
struct wlr_xdg_surface *surface = view->wlr_xdg_surface;
|
||||
enum wlr_edges edges = WLR_EDGE_NONE;
|
||||
if (tiled) {
|
||||
edges = WLR_EDGE_LEFT | WLR_EDGE_RIGHT | WLR_EDGE_TOP |
|
||||
WLR_EDGE_BOTTOM;
|
||||
}
|
||||
wlr_xdg_toplevel_set_tiled(surface, edges);
|
||||
}
|
||||
|
||||
static void set_fullscreen(struct sway_view *view, bool fullscreen) {
|
||||
if (xdg_shell_view_from_view(view) == NULL) {
|
||||
return;
|
||||
|
|
@ -157,6 +170,7 @@ static const struct sway_view_impl view_impl = {
|
|||
.get_string_prop = get_string_prop,
|
||||
.configure = configure,
|
||||
.set_activated = set_activated,
|
||||
.set_tiled = set_tiled,
|
||||
.set_fullscreen = set_fullscreen,
|
||||
.wants_floating = wants_floating,
|
||||
.for_each_surface = for_each_surface,
|
||||
|
|
@ -288,8 +302,6 @@ void handle_xdg_shell_surface(struct wl_listener *listener, void *data) {
|
|||
wlr_log(L_DEBUG, "New xdg_shell toplevel title='%s' app_id='%s'",
|
||||
xdg_surface->toplevel->title, xdg_surface->toplevel->app_id);
|
||||
wlr_xdg_surface_ping(xdg_surface);
|
||||
wlr_xdg_toplevel_set_tiled(xdg_surface, WLR_EDGE_LEFT | WLR_EDGE_RIGHT |
|
||||
WLR_EDGE_TOP | WLR_EDGE_BOTTOM);
|
||||
|
||||
struct sway_xdg_shell_view *xdg_shell_view =
|
||||
calloc(1, sizeof(struct sway_xdg_shell_view));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue