aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-03 17:26:15 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-03 17:26:15 +0000
commitd76484ae50efb8ede95e6b0921bdb1fad26dccd9 (patch)
treead48c41357c52953fd0dc0bb95174c85ad2712ae /render.c
parentrender: csd: render surfaces in reverse order (diff)
wayland: set window geometry to exclude the invisible CSD borders
But it *does* include the title bar. This simplifies the 'adjustment' needed to be done to the configured window size. It also fixes a number of issues: * the compositor will now properly snap the window to screen edges (before, there was an empty space between the edge and the window - the CSD border). * This also removes the need for the mutter 'commit' workaround. We must be doing something right now.
Diffstat (limited to 'render.c')
-rw-r--r--render.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/render.c b/render.c
index a492fb28..82abac4d 100644
--- a/render.c
+++ b/render.c
@@ -1416,16 +1416,9 @@ maybe_resize(struct terminal *term, int width, int height, bool force)
height = term->conf->height;
if (term->window->use_csd == CSD_YES) {
+ /* Take CSD title bar into account */
assert(!term->window->is_fullscreen);
-
- /* Account for CSDs, to make actual window size match
- * the configured size */
- if (!term->window->is_maximized) {
- width -= 2 * term->conf->csd.border_width;
- height -= 2 * term->conf->csd.border_width + term->conf->csd.title_height;
- } else {
- height -= term->conf->csd.title_height;
- }
+ height -= term->conf->csd.title_height;
}
width *= scale;
@@ -1556,10 +1549,27 @@ damage_view:
term->unmaximized_height = term->height;
}
+ render_csd(term);
+
+#if 0
+ /* TODO: doesn't include CSD title bar */
xdg_toplevel_set_min_size(
term->window->xdg_toplevel, min_width / scale, min_height / scale);
+#endif
+
+ {
+ bool title_shown = !term->window->is_fullscreen &&
+ term->window->use_csd == CSD_YES;
+
+ int title_height = title_shown ? term->conf->csd.title_height : 0;
+ xdg_surface_set_window_geometry(
+ term->window->xdg_surface,
+ 0,
+ -title_height,
+ term->width / term->scale,
+ term->height / term->scale + title_height);
+
- render_csd(term);
if (term->is_searching)
render_search_box(term);