#include "desktop-shell-client-protocol.h"
+#define ENABLE_TIZEN
+
extern char **environ; /* defined by libc */
struct desktop {
struct widget *widget;
struct wl_list launcher_list;
struct panel_clock *clock;
+#ifdef ENABLE_TIZEN
+ struct desktop *desktop;
+#endif
};
struct background {
if (button == BTN_RIGHT && state == WL_POINTER_BUTTON_STATE_PRESSED)
show_menu(panel, input, time);
+#ifdef ENABLE_TIZEN
+ if (button == BTN_LEFT && state == WL_POINTER_BUTTON_STATE_PRESSED) {
+ /*
+ * Work-around to return to home menu screen
+ * if the user click on the top taskbar panel
+ * since the taskbar don't have a home button icon
+ */
+ desktop_shell_show_homescreen(panel->desktop->shell);
+ }
+#endif
}
static void
panel_add_clock(panel);
+#ifdef ENABLE_TIZEN
+ panel->desktop = display_get_user_data(display);
+#endif
+
return panel;
}
#define DEFAULT_NUM_WORKSPACES 1
#define DEFAULT_WORKSPACE_CHANGE_ANIMATION_LENGTH 200
+#ifdef ENABLE_TIZEN
+#define DEFAULT_HOMESCREEN_NAME "org.tizen.menu-screen"
+#endif
enum animation_type {
ANIMATION_NONE,
shell->grab_surface = surface_resource->data;
}
+#ifdef ENABLE_TIZEN
+static void
+go_home(struct desktop_shell *shell, struct weston_seat *seat)
+{
+ struct weston_surface *surface;
+ struct shell_surface *shsurf;
+ struct weston_seat *s;
+ struct weston_compositor *ec = shell->compositor;
+
+ struct workspace *ws = get_current_workspace(shell);
+
+ /*
+ * Hack to show the home menu screen, since the shell doesn't really
+ * know which is the home surface, we check the title of surface to
+ * see if it is set to org.tizen.menu-screen and raise to the top
+ * of the stack
+ */
+ wl_list_for_each(surface, &ws->layer.surface_list, layer_link) {
+ shsurf = get_shell_surface(surface);
+ if (shsurf->title && !strcmp(DEFAULT_HOMESCREEN_NAME, shsurf->title)) {
+ if (seat)
+ activate(shell, surface, seat);
+ else {
+ wl_list_for_each(s, &ec->seat_list, link) {
+ activate(shell, surface, s);
+ }
+ }
+ }
+ }
+}
+
+/* Extended to show home screen */
+static void
+desktop_shell_show_homescreen(struct wl_client *client,
+ struct wl_resource *resource)
+{
+ struct desktop_shell *shell = resource->data;
+ go_home(shell, NULL);
+}
+#endif
+
static const struct desktop_shell_interface desktop_shell_implementation = {
desktop_shell_set_background,
desktop_shell_set_panel,
desktop_shell_set_lock_surface,
desktop_shell_unlock,
+#ifdef ENABLE_TIZEN
+ desktop_shell_set_grab_surface,
+ desktop_shell_show_homescreen, // extended to show home screen
+#else
desktop_shell_set_grab_surface
+#endif
};
static enum shell_surface_type