wio

a wayland wm stylised after plan9 rio - forked from git.sr.ht/~srcmpwn/wio
git clone git://src.gearsix.net/wio
Log | Files | Refs | Atom | Submodules | README | LICENSE

commit d304f66ead2ab0915411ad5f706b89cf2b066897
parent 8b6aeb237cce78b6729372158058cdd01da2f372
Author: Drew DeVault <sir@cmpwn.com>
Date:   Thu, 25 Apr 2019 15:28:35 -0400

Use effective resolution for window placement

Diffstat:
Mview.c | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/view.c b/view.c @@ -17,9 +17,11 @@ static void xdg_surface_map(struct wl_listener *listener, void *data) { if (view->x == -1 || view->y == -1) { struct wlr_surface_state *current = &view->xdg_surface->surface->current; + int owidth, oheight; + wlr_output_effective_resolution(output, &owidth, &oheight); wio_view_move(view, - layout->x + (output->width / 2 - current->width / 2), - layout->y + (output->height / 2 - current->height / 2)); + layout->x + (owidth / 2 - current->width / 2), + layout->y + (oheight / 2 - current->height / 2)); } else { // Sends wl_surface_enter wio_view_move(view, view->x, view->y);