aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/xdg_shell.c
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-06-03 16:35:06 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-06-09 10:08:43 +1000
commit59c94887018bdfa578c4371c4275061ca6e71b3e (patch)
tree62bdaa6ac4777d1fcb292013bddd2043dad7765a /sway/desktop/xdg_shell.c
parent0b798ed9543d55bd39782c3a4a4bc1789acd40d3 (diff)
WIP: Atomic layout updates ground work
Diffstat (limited to 'sway/desktop/xdg_shell.c')
-rw-r--r--sway/desktop/xdg_shell.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index d2b8822c..f43a0a1b 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -5,6 +5,7 @@
#include <wlr/types/wlr_xdg_shell.h>
#include <wlr/util/edges.h>
#include "log.h"
+#include "sway/desktop/transaction.h"
#include "sway/input/input-manager.h"
#include "sway/input/seat.h"
#include "sway/server.h"
@@ -87,18 +88,14 @@ static const char *get_string_prop(struct sway_view *view, enum sway_view_prop p
}
}
-static void configure(struct sway_view *view, double lx, double ly, int width,
- int height) {
+static uint32_t configure(struct sway_view *view, double lx, double ly,
+ int width, int height) {
struct sway_xdg_shell_view *xdg_shell_view =
xdg_shell_view_from_view(view);
if (xdg_shell_view == NULL) {
- return;
+ return 0;
}
-
- xdg_shell_view->pending_width = width;
- xdg_shell_view->pending_height = height;
- wlr_xdg_toplevel_set_size(view->wlr_xdg_surface, width, height);
- view_update_position(view, lx, ly);
+ return wlr_xdg_toplevel_set_size(view->wlr_xdg_surface, width, height);
}
static void set_activated(struct sway_view *view, bool activated) {
@@ -174,18 +171,12 @@ static void handle_commit(struct wl_listener *listener, void *data) {
struct sway_xdg_shell_view *xdg_shell_view =
wl_container_of(listener, xdg_shell_view, commit);
struct sway_view *view = &xdg_shell_view->view;
- if (view->swayc && container_is_floating(view->swayc)) {
- int width = view->wlr_xdg_surface->geometry.width;
- int height = view->wlr_xdg_surface->geometry.height;
- if (!width && !height) {
- width = view->wlr_xdg_surface->surface->current->width;
- height = view->wlr_xdg_surface->surface->current->height;
- }
- view_update_size(view, width, height);
- } else {
- view_update_size(view, xdg_shell_view->pending_width,
- xdg_shell_view->pending_height);
+ struct wlr_xdg_surface *xdg_surface = view->wlr_xdg_surface;
+
+ if (view->instructions->length) {
+ transaction_notify_view_ready(view, xdg_surface->configure_serial);
}
+
view_update_title(view, false);
view_damage_from(view);
}