Commit Graph

114 Commits

Author SHA1 Message Date
U. Artie Eoff 3c946779df clients/desktop-shell: check OOM conditions
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2014-01-19 22:01:12 -08:00
Kristian Høgsberg 4598f965fa desktop-shell: Remove debug code from previous commit 2014-01-01 16:32:09 -08:00
Kristian Høgsberg 7c4f6cc145 shell: Only assign focus on click if there is a pointer focus surface
If we don't have a background image from the desktop-shell client or the
pointer for some other reason doesn't have a focus we trigger a
segfault as we try to deref the seat->pointer->focus NULL pointer.

https://bugs.freedesktop.org/show_bug.cgi?id=73066
2014-01-01 16:28:32 -08:00
Xiong Zhang 83d8ee779e window, desktop-shell: deal with output unplug on client side
when output is removed, weston-desktop-shell should destroy panel
and background surface on destroyed output.

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
2013-10-23 22:36:37 -07:00
Kristian Høgsberg 67b8215bcb terminal: Add context menu with new terminal/copy/paste 2013-10-23 16:52:05 -07:00
Jason Ekstrand ee7fefcffc Rename frame_create and frame_set_child_size with a window_ prefix
This is to avoid a collision with an actual frame structure.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-10-13 22:12:16 -07:00
Kristian Høgsberg 6a11a8ab54 Revert "Resize the shell when the mode is switched"
This breaks panel resizing as it doesn't account for output rotation.

https://bugs.freedesktop.org/show_bug.cgi?id=70249

This reverts commit a356f7b1ef.
2013-10-09 15:23:16 -07:00
Hardening a356f7b1ef Resize the shell when the mode is switched
Resize the panel and the background when we're notified of a mode
switch.
2013-09-29 14:23:54 -07:00
Kristian Høgsberg 1abe0486bb config-parser: Make weston_config_parse() tkae a file name
Take a basename of the config file to parse instead of an fd.
2013-09-21 23:05:45 -07:00
Brian J Lovin c4df4082c2 desktop-shell: Add support for touch unlock
Add support for unlocking on touch up using the
green button on the unlock dialog

Signed-off-by: Brian J Lovin <brian.j.lovin@intel.com>
2013-08-26 22:11:11 -07:00
Rusty Lynch 1084da506e Add touch support for wl_shell_surface_move 2013-08-16 10:56:00 -07:00
Rusty Lynch 4384a24a9e desktop-shell: Add touch support to panel launcher icons 2013-08-12 16:54:10 -07:00
Peter Hutterer f3d62276d2 malloc + memset -> zalloc
And for clients using the xmalloc helper, use xzalloc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-08-08 13:46:13 -07:00
Tomeu Vizoso bee45a14cd window: Allow hinting of a preference for RGB565 when creating a window
And check if the renderer supports the RGB565 format for wl_shm buffers
before creating the cairo surface and requesting the buffer.

It can save quite some memory with big surfaces such as desktop
backgrounds.
2013-08-06 16:49:27 -07:00
Rob Bradford 09252d4b5e desktop-shell: Refactor launcher configuration reading to avoid leaking 2013-07-30 11:06:42 -07:00
Kristian Høgsberg b886212545 Use xmalloc in desktop-shell.c 2013-07-25 16:44:45 -07:00
Ander Conselvan de Oliveira e492549536 desktop-shell: Don't crash on output hotplug
The panel and background were never created for hotplugged outputs and
since some parts of the code assume that they always exist that would
lead to desktop-shell client to crash in that case.

This was easier to spot when the display was locked, because Weston
respawns the shell client and the user might not notice since there is
no flicker.

https://bugs.freedesktop.org/show_bug.cgi?id=66531
2013-07-05 16:48:32 -04:00
Ander Conselvan de Oliveira 6d75da7906 desktop-shell: Adapt to the new config parser API
This lets the code for adding panel launchers and setting up the
background to be moved into panel_* and background_* functions.

Note that this changes the behavior of the default launcher. Before
this change a default launcher would be added only if there was no
config file. Now a launcher is also added if there is no valid
launcher section.
2013-07-05 16:47:29 -04:00
Alexander Larsson edddbd14ac Convert all scales to int32_t
The type changed in the protocol, so update weston for this.
2013-05-28 15:27:45 -04:00
Pekka Paalanen a402b0567f desktop-shell: new wallpaper mode scale-crop
Scale-crop mode scales the wallpaper to tightly fill the whole output,
but preserving wallpaper aspect ratio. If aspect ratio differs from the
output's, the wallpaper is centered cutting it from top/bottom or
left/right.

Add this to the weston.ini man page, and explain all three modes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-05-22 18:07:30 -04:00
Pekka Paalanen 79346ab3a5 shell: wait for desktop-shell init before fade in
On Raspberry Pi, weston-desktop-shell is so slow to start, that the
compositor has time to run the fade-in before the wallpaper is up. The
user launching Weston sees the screen flipping to black, the fbcon
fading in, and then the desktop popping up.

To fix this, wait for the weston-desktop-shell to draw
everything before starting the initial fade-in. A new request is
added to the private desktop-shell protocol to signal it. If a
desktop-shell client does not support the new request, the fade-in
happens already at bind time.

If weston-desktop-shell crashes, or does not send the 'desktop_ready'
request in 15 seconds, the compositor will fade in anyway. This should
avoid a blocked screen in case weston-desktop-shell malfunction.

shell_fade_startup() does not directly start the fade-in but schedules
an idle callback, so that the compositor can process all pending events
before starting the fade clock. Otherwise (on RPi) we risk skipping part
of the animation. Yes, it is a hack, that should have been done in
window.c and weston-desktop-shell instead.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-05-22 18:07:30 -04:00
Alexander Larsson c584fa60d4 desktop-shell: Respect output scale and translate
We pick the window scale/tranform based on what the output uses, which means
we can avoid rotations in the compositor, and get sharper rendering
in scaled outputs.
2013-05-22 16:18:42 -04:00
Ossama Othman a50e6e4c50 config-parser: Honor XDG_CONFIG_DIRS
This set of changes adds support for searching for a given config file
in the directories listed in $XDG_CONFIG_DIRS if it wasn't found in
$XDG_CONFIG_HOME or ~/.config.  This allows packages to install custom
config files in /etc/xdg/weston, for example, thus allowing them to
avoid dealing with home directories.

To avoid a TOCTOU race the config file is actually open()ed during the
search.  Its file descriptor is returned and stored in the compositor
for later use when performing subsequent config file parses.

Signed-off-by: Ossama Othman <ossama.othman@intel.com>
2013-05-14 14:36:37 -04:00
Philipp Brüschweiler 96386b8e5e desktop-shell: better error logging
v2: only call cairo_surface_status once
2013-04-15 20:57:55 -04:00
Kristian Høgsberg 4172f668e7 Pass argc pointer to parse_options()
This lets us keep argc up to date as the backend picks out arguments
from the argv array.
2013-02-20 15:27:49 -05:00
Pekka Paalanen 9564c75163 desktop-shell: background should be opaque
Toytoolkit does not support setting opaqueness for anything else than
the immediate child widget of the frame widget. Backgrounds do not have
frames, so we need to poke it in manually.

This should allow Weston to paint the background without blending.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-10-25 14:59:23 -04:00
Kristian Høgsberg fa80e11c84 Update to new fd and wl_registry APIs
This commit updates the clients and the wayland compositor backend to
use the new wl_registry mechanism and the thread safe fd API.
2012-10-10 21:34:38 -04:00
U. Artie Eoff 44874d9f02 desktop-shell: destroy data before exiting.
desktop-shell never returned from display_run() since it
was essentially killed when weston exited.  To fix this,
it is necessary to watch for EPOLLHUP in window.c so that
toytoolkit clients will return from display_run() when
weston quits.  This allows for clients to clean up
as needed.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2012-10-04 11:37:40 -04:00
Philipp Brüschweiler 467668c9a4 desktop-shell: don't segfault on invalid icon path
Instead draw a fallback icon and proceed as normal.

https://bugs.freedesktop.org/show_bug.cgi?id=53860

v2: coding style fixes
v3: memory leak, draw icon instead of relying on external files
2012-08-29 15:31:25 -04:00
Philipp Brüschweiler 16d59d7780 desktop-shell: respect CURSOR_NONE as grab cursor 2012-08-29 15:12:57 -04:00
Pekka Paalanen b6df4f7de4 desktop-shell: use the standard 'environ' variable
The variable '__environ' seems to be libc implementation specific, and
not avaible on Android.

Use the POSIX standard variable 'environ', which also luckily happens to
be available on Android, which is not POSIX.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-08-03 13:32:36 -04:00
Kristian Høgsberg d1936b9e2b desktop-shell: Break command lines into env vars, executable and arguments
We now support specifying environment variables and arguments in launchers
by saying

  path=GDK_BACKEND=wayland gnome-terminal --full-screen

for example.

https://bugs.freedesktop.org/show_bug.cgi?id=47920
2012-07-23 22:59:33 -04:00
Scott Moreau ec116022ec desktop-shell: Declare grab_cursor as enum cursor_type. 2012-07-23 10:48:45 -04:00
Ander Conselvan de Oliveira 07a91cd9fd desktop-shell: Don't get a shell surface for the grab surface
The grab surface does not depend on any of the shell surface
functionality, so don't allocated one.
2012-07-16 13:35:26 -04:00
Martin Olsson 8df662ad87 clients: Silence 2x gcc 4.6.3 "warn_unused_result" compiler warnings
window.c:1173:6: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
desktop-shell.c:305:6: warning: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Wunused-result]
2012-07-09 17:50:46 -04:00
Ander Conselvan de Oliveira b9d2a0fc0a shell: Show approprite cursors during move and resize grabs
This patch expands the busy cursor mechanism so that it is possible for
the desktop-shell client to show the appropriate cursor during grabs.
2012-06-28 14:13:57 -04:00
Kristian Høgsberg 730c94d62e shell: Make the lock surface just a plain wl_surface too 2012-06-27 10:24:21 -04:00
Kristian Høgsberg af7b1ffaf4 shell: Make panel just a wl_surface too 2012-06-27 10:24:21 -04:00
Kristian Høgsberg 962342cb8e shell: Don't make desktop_shell background a wl_shell_surface
We don't gain anything from taking a wl_shell_surface in
desktop_surface.set_background, except making wl_shell_surface
gratuitously dependent on wl_shell.  In shell.c we can also handle
backgrounds in their own background_configure function which simplifies
the mapping and placement logic.
2012-06-26 16:29:53 -04:00
Ander Conselvan de Oliveira 80620076fc window: Implement animated cursors (using pointer surfaces)
Since the introduction of pointer.set_cursor(), it is possible for a
client to set the surface containing the pointer image and get frame
callbacks on it thus allowing a clear implementation of animated
cursors.

This also makes the busy cursor hack of using frame callbacks on the
busy surface unnecessary.
2012-06-15 11:03:12 -04:00
Pekka Paalanen 01b1725ba0 clients: don't crash weston-desktop-shell without the clock
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-12 12:29:17 -04:00
Kristian Høgsberg e9f68f66dc clock: Default to not show seconds
We can make it configurable, but for now, default to not showing seconds.
2012-06-11 12:24:12 -04:00
Kristian Høgsberg ed2aae7ab3 clock: Drop transparent background
Too hard to read.
2012-06-11 11:23:31 -04:00
Kristian Høgsberg 92a984a37b clock: Just always do strftime in redraw handler 2012-06-11 11:10:57 -04:00
Kristian Høgsberg bb262cf45c desktop-shell: Fix broken clock indentation 2012-06-11 11:03:03 -04:00
Rafal Mielniczuk b9e513c678 desktop-shell: move panel_add_clock call to panel_create function
Putting panel_add_clock in launcher_section_done handler
will cause clock to be created multiple times with every launcher.
Fix is to move the call to panel_create function.
2012-06-11 09:37:46 -04:00
Kristian Høgsberg 70226bbda6 clock: Read fd to avoid 100% cpu usage
In clock_func() it is necessary to read the timer fd, or
it will stay readable, and the event loop will call the function again.
That causes an endless loop.
2012-06-08 16:54:52 -04:00
Martin Minarik 1e51a87f13 desktop-shell: Add panel clock
A panel clock.
2012-06-08 12:52:06 -04:00
Kristian Høgsberg d56bd908bf shell: Use a busy cursor animation for unresponsive surfaces 2012-06-05 09:58:51 -04:00
Daniel Stone 4dbadb1556 Use enum wl_pointer_button_state instead of integer
Instead of using a uint32_t for state everywhere (except on the wire,
where that's still the call signature), use the new
wl_pointer_button_state enum, and explicit comparisons.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:42:47 -04:00