Commit Graph

1045 Commits

Author SHA1 Message Date
Pekka Paalanen
409ef0a5c8 compositor: refactor client forking code
shell.c and tablet-shell.c had almost the same code for forking their
special shell client. Generalise this code and put it into
wlsc_client_launch() in compositor.c.

Improve error cleanup and reporting in wlsc_client_launch().

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-08 10:42:00 +02:00
Pekka Paalanen
fd83b6d70f desktop-shell: add option to not use locking
Add an option to the desktop-shell ini file that defines whether screen
locking is used or not.

Useful for testing screensaver interactions without a lock surface.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-08 10:26:46 +02:00
Pekka Paalanen
28a20707a2 configparser: rename BOOL, document types
Rename CONFIG_KEY_BOOL to CONFIG_KEY_BOOLEAN, just like
CONFIG_KEY_INTEGER is not CONFIG_KEY_INT, for consistency.

Document the types expected for the void* and name the enum in the
header, so it is clear what config_key::type means.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-08 10:25:54 +02:00
Pekka Paalanen
c1765c67b3 move config parser to a convenience library
Create a new directory for convenience librariers that can be shared
between compositor components and clients.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-08 10:25:12 +02:00
Pekka Paalanen
02dfb75145 desktop-shell: no need to unset WAYLAND_SOCKET
As of commit "client: unset WAYLAND_SOCKET env variable",
58bb064afa3bfc706e3b30dd170804235aa272ea, in the Wayland core, the
Wayland library will unset the environment variable automatically.

No need to explicitly unset it again here.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-07 08:50:34 +02:00
David Herrmann
7172d9e22d compositor-tty: Fix ioctl error handling
(!x < 0) is always false and doesn't make sense here. Looks like a typo so
remove the negation.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2011-12-05 09:48:42 -05:00
Kristian Høgsberg
4bfb82adf7 compositor: Move a few more utils to util.c 2011-12-04 15:47:16 -05:00
Kristian Høgsberg
2f88a40c57 desktop-shell: Animate surface mapping 2011-12-04 15:32:59 -05:00
Kristian Høgsberg
698c058e2a compositor: Split the animation code out of tablet-shell
Upside: we can now reuse this.  Downside: we now have a util.c file.
2011-12-04 15:30:47 -05:00
Pekka Paalanen
f32f1fc743 shell: forbid multiple wl_shell_surface objects
Do not allow multiple wl_shell_surface objects to be created for a
wl_surface object.

Multiple shell_surface objects would confuse the compositor as they
contain separate instances of the shell-private data.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-04 14:56:06 -05:00
Pekka Paalanen
4622967586 shell: rename shell_create_shell_surface
Leftovers from an intermediate patch set, the proper function name is
shell_get_shell_surface. Cosmetic change.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-04 14:55:53 -05:00
Pekka Paalanen
6b2dc9119e window: do not crash without wl_shell
Since it is the desktop-shell plugin in the compositor that offers both
wl_shell global interface and wl_shell_surface interface, those are not
available on the tablet-shell plugin.

The tablet-shell client uses the toytoolkit, so toytoolkit must work
somehow even without wl_shell.

Turn all operations in toytoolkit that would require wl_shell or
wl_shell_surface into no-ops.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-04 14:55:40 -05:00
Pekka Paalanen
92a0dc455a shell: check for missing wl_shell_surface
get_shell_surface() returns NULL, if the client has not created or has
destroyed the wl_shell_surface object.

All but one use of get_shell_surface() just retrieve the surface type,
so just fall back to SHELL_SURFACE_NORMAL there.

Resize hot-key binding really needs the wl_shell_surface object, as that
is the only way to send configure events. For surfaces without a
wl_shell_surface, simply do not resize them.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-04 14:55:19 -05:00
Pekka Paalanen
ec2b32f49b compositor: eliminate wlsc_surface::shell_priv
Remove shell_priv member from wlsc_surface, and replace it by a search
through the wl_surface destroy_listener_list.

This technique avoids any "extension" members in the wlsc_surface
structure.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-04 14:54:40 -05:00
Pekka Paalanen
068ae944db desktop-shell: update protocol and client to wl_shell_surface
Change desktop-shell protocol to use wl_shell_surface instead of
wl_surface.

Adapt the desktop-shell client and the shell plugin.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-04 14:54:34 -05:00
Pekka Paalanen
9d1613eb4a wl_shell_surface adaptation
Protocol changes in Wayland core introduced a new interface
wl_shell_surface, and moved all wl_shell surface methods into it. Adapt
the compositor and its Wayland backend, shell plugin, and all clients to
the new interface.

Depends on the Wayland core commit "protocol: introduce wl_shell_surface"

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-04 14:54:26 -05:00
Kristian Høgsberg
865f9b87c9 evdev: Silence warning 2011-12-02 06:39:13 -05:00
Pekka Paalanen
a03a93c6ea window: fix segfault in window_handle_key()
When a window destroyed, if any input had the window in keyboard
focus, the keyboard focus is reset to NULL. A new keyboard focus is set
only, if the user clicks something. If the user presses a key instead of
clicking, the key press event is sent to the client which has NULL
keyboard focus, triggering a segfault in window_handle_key().

Fix the segfault by ignoring the key event, if there is no target
window.

I triggered this segfault by clicking the unlock dialog away, and then
pressing a key.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-02 06:31:08 -05:00
Pekka Paalanen
fe34083023 shell: fix resume_desktop for zero clients
Fix two bugs:

- if there are no backgrounds at all, the background pointer would have
  been bogus. Lead to a segfault.

- if the hidden_surface_list is empty, wl_list_insert_list() would
  corrupt the list. Lead to a hang in pick_surface().

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-02 06:31:07 -05:00
Pekka Paalanen
65c74cb18b compositor: add a comment about wlsc_surface::output
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-02 06:31:07 -05:00
Kristian Høgsberg
f033a7b6e6 tablet-shell: Add more interesting lock and home screens 2011-11-26 23:38:46 -05:00
Kristian Høgsberg
6336e46e15 tablet-shell: Add a stub tablet-shell client
For a start, this is just to we can run and test the corresponding
compositor plugin and keep it from bit-rotting.
2011-11-26 17:37:54 -05:00
Kristian Høgsberg
53ff2f6672 window.c: Cache outputs 2011-11-26 17:27:37 -05:00
Kristian Høgsberg
47fe08aad5 Implement the new dnd/selection protocol
The new protocol splits dnd/selection from wl_shell and allows us to move
the implementation out of shell.c.
2011-11-23 16:20:28 -05:00
Benjamin Franzke
f02bb64d62 shell: Unmap old backgrounds/panels when setting new ones 2011-11-23 20:46:40 +01:00
Benjamin Franzke
d0f79ab5ab desktop-shell: Make panel and background output dependent 2011-11-23 20:17:54 +01:00
Benjamin Franzke
8193bc1e9a desktop-shell: Unlock dialog needs to be a custom window
Since set_toplevel would overwrite set_lock_surface.
2011-11-23 19:36:28 +01:00
Benjamin Franzke
d775971e94 desktop-shell: Fix some indents 2011-11-23 17:19:38 +01:00
Kristian Høgsberg
d2abb83634 compositor: Move more shell.c state into the new shell_surface 2011-11-23 10:53:08 -05:00
Kristian Høgsberg
f6def545bc Merge remote-tracking branch 'pq/shell-priv' 2011-11-23 10:40:11 -05:00
Kristian Høgsberg
a8873120c4 compositor: The compositor is now jiust a regular global object
We have to provide our own bind callback and add a wlsc_compositor pointer
to wlsc_input_device, but on the whole it's nice cleanup.
2011-11-23 10:39:34 -05:00
Kristian Høgsberg
6b5fc3bac0 compositor: Remove a couple of unused #defines 2011-11-23 10:17:41 -05:00
Kristian Høgsberg
558350a692 compositor: Remove unused resource field from wlsc_output 2011-11-23 10:17:15 -05:00
Pekka Paalanen
57da4a822e shell: introduce shell_surface_purpose
Enumerate the different surface purposes for the shell: background, panel,
lock surface, and normal (other) surfaces.

Instead of testing wlsc_surface pointers against known pointers, check
the purpose field.

This change will ease implementing per-output background, panel, etc.
when the number of "known" surface pointers grows dynamically.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-23 16:43:43 +02:00
Pekka Paalanen
56cdea96f0 shell: add private surface struct
Add a pointer to wlsc_surface for shell-private data. This is a
temporary solution.

Add struct shell_surface, where you can add any shell-private data
members related to a wlsc_surface. The getter function takes care of
creating the private data if it does not exist yet.

Not used anywhere yet.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-23 16:14:12 +02:00
Kristian Høgsberg
2584cb5890 compositor: Set output for cursor surface so damage_below works 2011-11-22 19:47:57 -05:00
Kristian Høgsberg
db0fa54b5a Simplify evdev_flush_motion() a tiny bit 2011-11-22 19:24:25 -05:00
Kristian Høgsberg
f127715ce2 Merge remote-tracking branch 'vignatti/evdev' 2011-11-22 19:21:34 -05:00
Kristian Høgsberg
02453dd699 cairo-util: Dont use non-standard JCS_EXT_BGRX color space
Everytime somebody has to write a channel swizzling loop,
God kills a kitten... and a dolphin and a unicorn.
2011-11-22 14:40:48 -05:00
Kristian Høgsberg
c5241f5b73 Never include wayland-util.h directly
And fix a missing "" to <> conversion for wayland-client.h include.
2011-11-22 09:35:14 -05:00
Pekka Paalanen
50719bce2a Fix inconsistent #include style
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-22 09:27:03 -05:00
Tiago Vignatti
f547bd36e6 evdev: fetch absolute coordinates inside flush_motion only
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-11-22 12:05:22 +02:00
Tiago Vignatti
5c900ce08d evdev: remove useless field from device structure
We'll want to enhance later the driver regarding the tool being used, but for
now just remove unused bits.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-11-21 23:47:26 +02:00
Tiago Vignatti
80885e16b3 evdev: reset accumulator inside evdev_flush_motion
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-11-21 23:45:30 +02:00
Tiago Vignatti
a52b2e4b20 evdev: use a separate structure to denote accumulated motion events
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-11-21 23:45:05 +02:00
Tiago Vignatti
a157fc11a9 evdev: use a separate struct for abs information
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-11-21 23:42:33 +02:00
Tiago Vignatti
280b8a6a3b tty: fix command line parsing
revert typo from evdev commit 8b568806.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2011-11-21 18:07:18 +02:00
Kristian Høgsberg
980c49e6cd window: Remove unused variable 2011-11-18 15:24:23 -05:00
Kristian Høgsberg
8b568806aa evdev: Reset accumulate values when we flush motion events
Otherwise we end up reporting all motion events twice.
2011-11-18 10:42:34 -05:00
Kristian Høgsberg
e412ff3025 Merge remote-tracking branch 'pq/glmatrix' 2011-11-18 09:57:50 -05:00