From 6af8eb9c7f32799ddc75e1732c50fbd23fb56994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 25 Jan 2012 16:57:11 -0500 Subject: [PATCH] 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. --- clients/desktop-shell.c | 28 +++++++++++++++++++++------- data/COPYING | 5 +++++ data/Makefile.am | 4 +++- data/pattern.png | Bin 0 -> 1846 bytes data/terminal.png | Bin 0 -> 1005 bytes src/shell.c | 10 +++------- 6 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 data/pattern.png create mode 100644 data/terminal.png 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 0000000000000000000000000000000000000000..5ac8986d6721b4c19794f1d24e513af7015aa395 GIT binary patch literal 1846 zcmV-62g&$}P)r~C#{PdYlVhp;R2PK4doYbCEL-j*f%te=_#S;EM|Na*MoK7bnf^%-$wyhNBoO5nj z&Vb;K#()3%%Y7VqnsUyszpKdi_jjM8s&(5wpVddJZC!8Zy+19B_x`?1&cTOuy*cN$ zt(VVdW8KHcNdnoS!A6Prsh#+agW&U-)4 zr_<@a%6oskUh7tO3x)Z1yV-^zMtpT>nrCxkU2no{v1zSYgj8gnPt&w_)x4di*}UrL z8cx05_n)S5$rw~sEoHrYf4AD0n2Ad%*Xxy;Z30?^cEfugW308R>h*d}Ik(oFbJSYS zIRG3c&PK|Ks1cEcGw19>XtkBHT99Ilhll=fPsEVx3CJ2V|J z5|MMR)+e&ZukL>w-ur&^fyKfc0A4fhoI^xaE$eC__uhZ~`t>>u0Gx9WK%L4<35NFp zW}-f)FZAB0n6`Q^S!}gg5%dbXTrTf+1i;$>snhA0Nr=fg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CCLt$)TZDDR?a%E}Xks2xh001d;MObu1WpiV4X>fFDZ*BlWVRL0Rq@fsA8rFv0hCf)+uB;l-~X_;M~o2|Ta;2_ zlBOq*9!+1=TBDSr_j-@UN`pMldGPZC9_~M+exXjU+rv3Wzu#v#95NgZao&?sBBgY; zz)E9<8*kmfImgbeTPOvqt7~YjP(~v_tJCJyD_6L@vW&470HrlbE8OAHoPZu#bShAJ z&*xu$!E0Bqa{Kmopf!S!JICY42joS8HimZRd5WSSAD43l!#oE-M2PWk9Zb+{wdi%b zbh};d+`Y@%i)&=H8UpwfXm#4GzqC%RUPD9(DG^g7N+OC-xRP1Ur!4XzaCm&o8*g66 z2T!Nn=43FS@}9$^Bed2mEiEw^4souaC>(j7PiHXcU`}AxqGq$n{{B7}FJ0m}qj_ax zgLbn;?s5(epU`P{u(b>ku(cXljMUQw;+W7C?re*uGYB4wV3c5#;pO#p8jU8-72Laj zA8if&lRm!klvPDpI*L4}sz&GG%nnkDGbw6}4wSW6W4QCvJrqz@6{|0-l4TjuXcCYy z`o`Fd7y=;#PLBIyfthnKYmxUAGIN~_1{h;7#!&hSS32T2hA~EB3{&#p{eP$E^71m7 zwU{i!&a4M*G+OIvLQ)(FOo*fR_z?K>_dotUMP*r%M6iIU)3RE@*pehdNRbc&A&mEt z_xP&%rx~0I{PxSQoELKfN-4Fubq#=Tc6QE9J`tFmL6%ZtcW;->W(yJUVYKj+QpN(c zs;qw8-TQuXA?#y_$hUx1z(rsK*aQrq&dUvW;A`MOjY(@jeF5YXB%lC-5)qVAYJubv bh=|Bv8b1-Z;i*mk00000NkvXXu0mjftX;i` literal 0 HcmV?d00001 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)