summaryrefslogtreecommitdiff
path: root/clients/desktop-shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'clients/desktop-shell.c')
-rw-r--r--clients/desktop-shell.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index 599c0a5b..4e7a815e 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -95,6 +95,7 @@ struct background {
struct output {
struct wl_output *output;
+ uint32_t server_output_id;
struct wl_list link;
struct panel *panel;
@@ -142,7 +143,7 @@ sigchild_handler(int s)
}
static void
-menu_func(struct window *window, int index, void *data)
+menu_func(struct window *window, struct input *input, int index, void *data)
{
printf("Selected index %d from a panel menu.\n", index);
}
@@ -896,7 +897,7 @@ unlock_dialog_create(struct desktop *desktop)
dialog = xzalloc(sizeof *dialog);
dialog->window = window_create_custom(display);
- dialog->widget = frame_create(dialog->window, dialog);
+ dialog->widget = window_frame_create(dialog->window, dialog);
window_set_title(dialog->window, "Unlock your desktop");
window_set_user_data(dialog->window, dialog);
@@ -1213,6 +1214,7 @@ create_output(struct desktop *desktop, uint32_t id)
output->output =
display_bind(desktop->display, id, &wl_output_interface, 2);
+ output->server_output_id = id;
wl_output_add_listener(output->output, &output_listener, output);
@@ -1242,6 +1244,23 @@ global_handler(struct display *display, uint32_t id,
}
static void
+global_handler_remove(struct display *display, uint32_t id,
+ const char *interface, uint32_t version, void *data)
+{
+ struct desktop *desktop = data;
+ struct output *output;
+
+ if (!strcmp(interface, "wl_output")) {
+ wl_list_for_each(output, &desktop->outputs, link) {
+ if (output->server_output_id == id) {
+ output_destroy(output);
+ break;
+ }
+ }
+ }
+}
+
+static void
panel_add_launchers(struct panel *panel, struct desktop *desktop)
{
struct weston_config_section *s;
@@ -1298,6 +1317,7 @@ int main(int argc, char *argv[])
display_set_user_data(desktop.display, &desktop);
display_set_global_handler(desktop.display, global_handler);
+ display_set_global_handler_remove(desktop.display, global_handler_remove);
/* Create panel and background for outputs processed before the shell
* global interface was processed */