diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-01 10:58:13 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-07 00:03:49 +1000 |
commit | 58befcf2cdf261b8898b6fd1288a69d367101ff1 (patch) | |
tree | 7fdb6fa8b637f814309157425f59a87891106d7b | |
parent | Merge pull request #2220 from ianyfan/remove-input-fix (diff) | |
download | sway-58befcf2cdf261b8898b6fd1288a69d367101ff1.tar.gz sway-58befcf2cdf261b8898b6fd1288a69d367101ff1.tar.zst sway-58befcf2cdf261b8898b6fd1288a69d367101ff1.zip |
Don't send frame done to surfaces behind lockscreen
Also, when rendering, don't descend into the tree if the lockscreen is
active. Just render the lockscreen's surfaces.
-rw-r--r-- | sway/desktop/output.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 1211cc07..52bd1666 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -948,8 +948,30 @@ static void render_output(struct sway_output *output, struct timespec *when, | |||
948 | 948 | ||
949 | struct sway_container *workspace = output_get_active_workspace(output); | 949 | struct sway_container *workspace = output_get_active_workspace(output); |
950 | struct sway_view *fullscreen_view = workspace->current.ws_fullscreen; | 950 | struct sway_view *fullscreen_view = workspace->current.ws_fullscreen; |
951 | struct sway_seat *seat = input_manager_current_seat(input_manager); | ||
952 | |||
953 | if (seat->exclusive_client && seat->focused_layer) { | ||
954 | float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f}; | ||
955 | |||
956 | int nrects; | ||
957 | pixman_box32_t *rects = pixman_region32_rectangles(damage, &nrects); | ||
958 | for (int i = 0; i < nrects; ++i) { | ||
959 | scissor_output(wlr_output, &rects[i]); | ||
960 | wlr_renderer_clear(renderer, clear_color); | ||
961 | } | ||
951 | 962 | ||
952 | if (fullscreen_view) { | 963 | struct wlr_layer_surface *wlr_layer_surface = seat->focused_layer; |
964 | struct sway_layer_surface *sway_layer_surface = | ||
965 | layer_from_wlr_layer_surface(seat->focused_layer); | ||
966 | struct render_data data = { | ||
967 | .output = output, | ||
968 | .damage = damage, | ||
969 | .alpha = 1.0f, | ||
970 | }; | ||
971 | surface_for_each_surface(wlr_layer_surface->surface, | ||
972 | sway_layer_surface->geo.x, sway_layer_surface->geo.y, | ||
973 | &data.root_geo, render_surface_iterator, &data); | ||
974 | } else if (fullscreen_view) { | ||
953 | float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f}; | 975 | float clear_color[] = {0.0f, 0.0f, 0.0f, 1.0f}; |
954 | 976 | ||
955 | int nrects; | 977 | int nrects; |
@@ -1019,11 +1041,16 @@ struct send_frame_done_data { | |||
1019 | struct root_geometry root_geo; | 1041 | struct root_geometry root_geo; |
1020 | struct sway_output *output; | 1042 | struct sway_output *output; |
1021 | struct timespec *when; | 1043 | struct timespec *when; |
1044 | struct wl_client *exclusive_client; | ||
1022 | }; | 1045 | }; |
1023 | 1046 | ||
1024 | static void send_frame_done_iterator(struct wlr_surface *surface, | 1047 | static void send_frame_done_iterator(struct wlr_surface *surface, |
1025 | int sx, int sy, void *_data) { | 1048 | int sx, int sy, void *_data) { |
1026 | struct send_frame_done_data *data = _data; | 1049 | struct send_frame_done_data *data = _data; |
1050 | if (data->exclusive_client && | ||
1051 | data->exclusive_client != surface->resource->client) { | ||
1052 | return; | ||
1053 | } | ||
1027 | 1054 | ||
1028 | bool intersects = get_surface_box(&data->root_geo, data->output, surface, | 1055 | bool intersects = get_surface_box(&data->root_geo, data->output, surface, |
1029 | sx, sy, NULL); | 1056 | sx, sy, NULL); |
@@ -1072,9 +1099,11 @@ static void send_frame_done_container(struct send_frame_done_data *data, | |||
1072 | } | 1099 | } |
1073 | 1100 | ||
1074 | static void send_frame_done(struct sway_output *output, struct timespec *when) { | 1101 | static void send_frame_done(struct sway_output *output, struct timespec *when) { |
1102 | struct sway_seat *seat = input_manager_current_seat(input_manager); | ||
1075 | struct send_frame_done_data data = { | 1103 | struct send_frame_done_data data = { |
1076 | .output = output, | 1104 | .output = output, |
1077 | .when = when, | 1105 | .when = when, |
1106 | .exclusive_client = seat->exclusive_client, | ||
1078 | }; | 1107 | }; |
1079 | 1108 | ||
1080 | struct sway_container *workspace = output_get_active_workspace(output); | 1109 | struct sway_container *workspace = output_get_active_workspace(output); |