]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Partially revert a bit more of ddc9047
authorJohan Malm <jgm323@gmail.com>
Fri, 8 Dec 2023 22:08:46 +0000 (22:08 +0000)
committerJohan Malm <johanmalm@users.noreply.github.com>
Fri, 8 Dec 2023 22:13:02 +0000 (22:13 +0000)
...to enable re-size of nested labwc instances

src/output.c

index f154c194aca3cb10d294f82f773d0fee37a510ca..e9ed98004a62649dd00b5b0d5b600f594a306607 100644 (file)
 static void
 output_frame_notify(struct wl_listener *listener, void *data)
 {
+       /*
+        * This function is called every time an output is ready to display a
+        * frame - which is typically at 60 Hz.
+        */
        struct output *output = wl_container_of(listener, output, frame);
        if (!output_is_usable(output)) {
                return;
@@ -120,33 +124,7 @@ output_request_state_notify(struct wl_listener *listener, void *data)
        /* This ensures nested backends can be resized */
        struct output *output = wl_container_of(listener, output, request_state);
        const struct wlr_output_event_request_state *event = data;
-       struct wlr_output_state *pending = &output->wlr_output->pending;
-
-       if (!pending->committed) {
-               /* No pending changes, just use the supplied state as new pending */
-               wlr_output_state_copy(pending, event->state);
-               wlr_output_schedule_frame(output->wlr_output);
-               return;
-       }
-
-       if (event->state->committed == WLR_OUTPUT_STATE_MODE) {
-               /* Only the resolution has changed, apply to pending */
-               switch (event->state->mode_type) {
-               case WLR_OUTPUT_STATE_MODE_FIXED:
-                       wlr_output_set_mode(output->wlr_output, event->state->mode);
-                       break;
-               case WLR_OUTPUT_STATE_MODE_CUSTOM:
-                       wlr_output_set_custom_mode(output->wlr_output,
-                               event->state->custom_mode.width,
-                               event->state->custom_mode.height,
-                               event->state->custom_mode.refresh);
-                       break;
-               }
-               wlr_output_schedule_frame(output->wlr_output);
-               return;
-       }
 
-       /* Fallback path for everything that we didn't handle above */
        if (!wlr_output_commit_state(output->wlr_output, event->state)) {
                wlr_log(WLR_ERROR, "Backend requested a new state that could not be applied");
        }