summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-01-25 16:57:11 -0500
committerKristian Høgsberg <krh@bitplanet.net>2012-01-25 20:53:08 -0500
commit6af8eb9c7f32799ddc75e1732c50fbd23fb56994 (patch)
tree603efca35b722a1a0d66609c813b33e91916842d
parent07f729441ea1e9a6b17fff0bd2453677190b6643 (diff)
downloadweston-6af8eb9c7f32799ddc75e1732c50fbd23fb56994.tar.gz
desktop-shell: Build in sensible defaults
This adds a default background pattern and a terminal launcher in case we don't have a config file.
-rw-r--r--clients/desktop-shell.c28
-rw-r--r--data/COPYING5
-rw-r--r--data/Makefile.am4
-rw-r--r--data/pattern.pngbin0 -> 1846 bytes
-rw-r--r--data/terminal.pngbin0 -> 1005 bytes
-rw-r--r--src/shell.c10
6 files changed, 32 insertions, 15 deletions
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index 7116a7d5..a6a61477 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -95,10 +95,10 @@ struct unlock_dialog {
struct desktop *desktop;
};
-static char *key_background_image;
-static char *key_background_type;
-static uint32_t key_panel_color;
-static uint32_t key_background_color;
+static char *key_background_image = DATADIR "/weston/pattern.png";
+static char *key_background_type = "tile";
+static uint32_t key_panel_color = 0xaa000000;
+static uint32_t key_background_color = 0xff002244;
static char *key_launcher_icon;
static char *key_launcher_path;
static void launcher_section_done(void *data);
@@ -690,11 +690,23 @@ launcher_section_done(void *data)
key_launcher_path = NULL;
}
+static void
+add_default_launcher(struct desktop *desktop)
+{
+ struct output *output;
+
+ wl_list_for_each(output, &desktop->outputs, link)
+ panel_add_launcher(output->panel,
+ DATADIR "/weston/terminal.png",
+ "/usr/bin/weston-terminal");
+}
+
int main(int argc, char *argv[])
{
struct desktop desktop = { 0 };
char *config_file;
struct output *output;
+ int ret;
desktop.unlock_task.run = unlock_dialog_finish;
wl_list_init(&desktop.outputs);
@@ -721,10 +733,12 @@ int main(int argc, char *argv[])
}
config_file = config_file_path("weston-desktop-shell.ini");
- parse_config_file(config_file,
- config_sections, ARRAY_LENGTH(config_sections),
- &desktop);
+ ret = parse_config_file(config_file,
+ config_sections, ARRAY_LENGTH(config_sections),
+ &desktop);
free(config_file);
+ if (ret < 0)
+ add_default_launcher(&desktop);
signal(SIGCHLD, sigchild_handler);
diff --git a/data/COPYING b/data/COPYING
index b9d6c37d..430a864d 100644
--- a/data/COPYING
+++ b/data/COPYING
@@ -1,6 +1,11 @@
+For the DMZ cursors:
+
(c) 2007-2010 Novell, Inc.
This work is licenced under the Creative Commons Attribution-Share Alike 3.0
United States License. To view a copy of this licence, visit
http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative
Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA.
+
+The terminal icon is taken from the gnome-icon-theme collection which
+is also distributed under the Creative Commons BY-SA 3.0 license. \ No newline at end of file
diff --git a/data/Makefile.am b/data/Makefile.am
index c9193813..a05989cf 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -20,7 +20,9 @@ dist_westondata_DATA = \
top_side.png \
xterm.png \
wayland.svg \
- $(wayland_icon_png)
+ $(wayland_icon_png) \
+ pattern.png \
+ terminal.png
if HAVE_RSVG_CONVERT
wayland_icon_png = wayland.png
diff --git a/data/pattern.png b/data/pattern.png
new file mode 100644
index 00000000..5ac8986d
--- /dev/null
+++ b/data/pattern.png
Binary files differ
diff --git a/data/terminal.png b/data/terminal.png
new file mode 100644
index 00000000..3c02dd21
--- /dev/null
+++ b/data/terminal.png
Binary files differ
diff --git a/src/shell.c b/src/shell.c
index 522a2730..cf94e8e1 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -110,10 +110,9 @@ struct weston_move_grab {
int32_t dx, dy;
};
-static int
+static void
shell_configuration(struct wl_shell *shell)
{
- int ret;
char *config_file;
char *path = NULL;
int duration = 60;
@@ -128,13 +127,11 @@ shell_configuration(struct wl_shell *shell)
};
config_file = config_file_path("weston-desktop-shell.ini");
- ret = parse_config_file(config_file, cs, ARRAY_LENGTH(cs), shell);
+ parse_config_file(config_file, cs, ARRAY_LENGTH(cs), shell);
free(config_file);
shell->screensaver.path = path;
shell->screensaver.duration = duration;
-
- return ret;
}
static void
@@ -1447,8 +1444,7 @@ shell_init(struct weston_compositor *ec)
wl_list_init(&shell->panels);
wl_list_init(&shell->screensaver.surfaces);
- if (shell_configuration(shell) < 0)
- return -1;
+ shell_configuration(shell);
if (wl_display_add_global(ec->wl_display, &wl_shell_interface,
shell, bind_shell) == NULL)