mirror of
https://github.com/swaywm/sway.git
synced 2024-11-21 23:41:27 +00:00
desktop/output: Expose request_modeset
We remove the struct sway_server argument for consistency with the rest
of our internal APIs which rely on the global server instance.
(cherry picked from commit b73f54a966
)
This commit is contained in:
parent
952c428482
commit
4aa71ca661
|
@ -704,6 +704,8 @@ struct output_config *find_output_config(struct sway_output *output);
|
|||
|
||||
void free_output_config(struct output_config *oc);
|
||||
|
||||
void request_modeset(void);
|
||||
|
||||
bool spawn_swaybg(void);
|
||||
|
||||
int workspace_output_cmp_workspace(const void *a, const void *b);
|
||||
|
|
|
@ -408,17 +408,15 @@ static int timer_modeset_handle(void *data) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void request_modeset(struct sway_server *server) {
|
||||
if (server->delayed_modeset == NULL) {
|
||||
server->delayed_modeset = wl_event_loop_add_timer(server->wl_event_loop,
|
||||
timer_modeset_handle, server);
|
||||
wl_event_source_timer_update(server->delayed_modeset, 10);
|
||||
void request_modeset(void) {
|
||||
if (server.delayed_modeset == NULL) {
|
||||
server.delayed_modeset = wl_event_loop_add_timer(server.wl_event_loop,
|
||||
timer_modeset_handle, &server);
|
||||
wl_event_source_timer_update(server.delayed_modeset, 10);
|
||||
}
|
||||
}
|
||||
|
||||
static void begin_destroy(struct sway_output *output) {
|
||||
struct sway_server *server = output->server;
|
||||
|
||||
if (output->enabled) {
|
||||
output_disable(output);
|
||||
}
|
||||
|
@ -439,7 +437,7 @@ static void begin_destroy(struct sway_output *output) {
|
|||
output->wlr_output->data = NULL;
|
||||
output->wlr_output = NULL;
|
||||
|
||||
request_modeset(server);
|
||||
request_modeset();
|
||||
}
|
||||
|
||||
static void handle_destroy(struct wl_listener *listener, void *data) {
|
||||
|
@ -575,7 +573,7 @@ void handle_new_output(struct wl_listener *listener, void *data) {
|
|||
sway_session_lock_add_output(server->session_lock.lock, output);
|
||||
}
|
||||
|
||||
request_modeset(server);
|
||||
request_modeset();
|
||||
}
|
||||
|
||||
void handle_gamma_control_set_gamma(struct wl_listener *listener, void *data) {
|
||||
|
@ -696,5 +694,5 @@ void handle_output_power_manager_set_mode(struct wl_listener *listener,
|
|||
break;
|
||||
}
|
||||
store_output_config(oc);
|
||||
request_modeset(output->server);
|
||||
request_modeset();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue