/* geometry of the wlr_surface contained within the view */
int x, y, w, h;
+ /* geometry before maximize */
+ struct wlr_box unmaximized_geometry;
+
/*
* margin refers to the space between the extremities of the
* wlr_surface and the max extents of the server-side decorations.
wlr_output_layout_get(layout, output);
assert(layout);
- if(output == NULL)
- {
- die("output NULL w/ x and y of: %d, %d", view->x, view->y);
- }
assert(output);
assert(ol_output);
+ view->unmaximized_geometry.x = view->x;
+ view->unmaximized_geometry.y = view->y;
+ view->unmaximized_geometry.width = view->w;
+ view->unmaximized_geometry.height = view->h;
+
int x = ol_output->x;
int y = ol_output->y;
int width = output->width;
view_move(view, box.x * output->scale, box.y * output->scale);
view->maximized = true;
- }
- else
- {
- struct wlr_box box = {
- .x = 20,
- .y = 50,
- .width = 640,
- .height = 480
- };
-
- view_move_resize(view, box);
+ } else {
+ /* unmaximize */
+ view_move_resize(view, view->unmaximized_geometry);
view->maximized = false;
}
view->impl->maximize(view, maximize);