Commit graph

133 commits

Author SHA1 Message Date
Kristian Høgsberg b2af93ef8c compositor: Drop weston_surface_to_global()
Just always call weston_surface_to_global_float() instead.
2012-06-07 20:10:23 -04:00
Kristian Høgsberg 633b14505c shell: Emit destroy signal for when we manually destroy shell surface 2012-06-07 18:08:47 -04:00
Kristian Høgsberg 47b5dca409 shell: Don't remove grab listener if surface was destroyed 2012-06-07 18:08:04 -04:00
Pekka Paalanen 43e1ba8073 shell: fix crash when no pointer device
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-07 16:43:56 -04:00
Pekka Paalanen 4e1f2ff1c6 shell: fix a crash during 'make check'
$ abs_builddir=$PWD/tests gdb -args ./src/weston --module=$PWD/tests/.libs/event-test.so

(gdb) run
Starting program: /home/pq/git/wayland-demos/src/weston --module=/home/pq/git/wayland-demos/tests/.libs/event-test.so
[Thread debugging using libthread_db enabled]
Mesa: Initializing x86-64 optimizations
launching /home/pq/git/wayland-demos/tests/test-client
created output global 0x608f50
test-client: got create-surface
got surface 5 from client
got surface id 5

Program received signal SIGSEGV, Segmentation fault.
Mesa: Initializing x86-64 optimizations
0x00007fffeff72c7c in handle_pointer_focus (listener=0x74f5c0, data=0x6faa40) at shell.c:492
492		if (shsurf->unresponsive) {
(gdb) bt
 #0  0x00007fffeff72c7c in handle_pointer_focus (listener=0x74f5c0, data=0x6faa40) at shell.c:492
 #1  0x00007ffff5ed8b87 in wl_signal_emit (data=0x6faa40, signal=0x6faa88) at wayland-server.h:166
 #2  wl_pointer_set_focus (pointer=0x6faa40, surface=<optimized out>, sx=12800, sy=12800) at wayland-server.c:752
 #3  0x0000000000407d92 in weston_device_repick (seat=0x6fa930) at compositor.c:633
 #4  0x0000000000407e49 in weston_compositor_repick (compositor=0x61c510) at compositor.c:656
 #5  0x00000000004092e1 in weston_output_repaint (output=0x7b85b0, msecs=-1046834186) at compositor.c:1059
 #6  0x00000000004094b4 in weston_output_finish_frame (output=0x7b85b0, msecs=-1046834186) at compositor.c:1092
 #7  0x00007ffff211e3c1 in finish_frame_handler (data=0x7b85b0) at compositor-x11.c:284
 #8  0x00007ffff5eda603 in wl_event_source_timer_dispatch (source=0x79ee50, ep=<optimized out>) at event-loop.c:173
 #9  0x00007ffff5edaca0 in wl_event_loop_dispatch (loop=0x61b940, timeout=<optimized out>) at event-loop.c:410
 #10 0x00007ffff5ed8dbd in wl_display_run (display=0x61b8f0) at wayland-server.c:1025
 #11 0x000000000040ecb1 in main (argc=1, argv=0x7fffffffdd98) at compositor.c:3225
(gdb) print shsurf
$1 = (struct shell_surface *) 0x0

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-06 13:27:56 -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 0c1e46eb18 Use wl_fixed_t for axis bindings
In preparation for axis values being wl_fixed_t in the protocol as well.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:20 -04:00
Daniel Stone 325fc2d53a Split bindings into separate key/button/axis bindings
Rather than attempting to have the one handler prototype everywhere.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:16 -04:00
Daniel Stone b21046836f shell: Reset focus for all seats on activation
Rather than using a single hardcoded seat to activate new windows within
a compositor, reset the focus for all seats.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:02 -04:00
Daniel Stone c9785eacca Use enum wl_keyboard_key_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_keyboard_key_state enum, and explicit comparisons.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:43:03 -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
Daniel Stone 496ca17a77 Convert Weston modifier #defines to an enum
To avoid any possible collision between the disparate XKB and Weston
modifier namespaces.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:28:23 -04:00
Daniel Stone 351eb61fbc Support wl_keyboard::modifiers event
This event lets the compositor inform clients of the canonical keyboard
modifier/group state.  Make sure we send it at appropriate moments from
the compositor, and listen for it in clients as well.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:27:47 -04:00
Scott Moreau 7a1b32a198 Implement text cursor position protocol.
Here we create a new client/compositor interface in weston to allow
clients to report their x/y cursor position to the compositor. These
values are then used to center the zoom area on this point. This
is useful for everyone, especially people who are visually impaired.
2012-05-31 13:10:22 -04:00
Kristian Høgsberg 92a57db6f2 shell: Add keybinding to force-close (SIGKILL) inactive clients 2012-05-26 13:41:06 -04:00
Tiago Vignatti 99aeb1e72d shell: use transient flags for activate or not new surfaces
Inactive surfaces doesn't set keyboard focus, so it can be used for tooltips,
toolbars and some other type of windows.

This requires protocol side changes.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-05-25 22:52:03 -04:00
Kristian Høgsberg c1693f209a xwm: Implement resizing by frame borders 2012-05-22 16:56:23 -04:00
Kristian Høgsberg a61ca06b49 xwm: Add window resize support 2012-05-22 16:05:52 -04:00
Kristian Høgsberg 9b68af0608 shell: Add back mod+pageup/down keybindings for zoom
This way we can use zoom without a scrollwheel/touchpad.
2012-05-22 12:58:47 -04:00
Scott Moreau 850ca42b9b Restructure output zoom.
A quick clean-up of zoom to prepare for the other patches in this series.
2012-05-22 12:58:47 -04:00
Scott Moreau 02709afb51 shell: Update relevant bits to work with recent alpha value changes. 2012-05-22 11:33:36 -04:00
Kristian Høgsberg 9540ea61a0 shell: Fix broken indentation in shell_get_shell_surface() 2012-05-21 17:03:16 -04:00
Kristian Høgsberg 45ba869ff3 shell: Make create_shell_surface() just return the shsurf 2012-05-21 17:03:16 -04:00
Kristian Høgsberg a416fa15d5 xwm: Switch alpha, brightness and saturation to GLfloat 2012-05-21 17:03:06 -04:00
Rob Bradford 579f2934de shell: Remove fading animation from animation list when surface destroyed
Fixes crash with a backtrace like this:

==2418== Invalid read of size 8
==2418==    at 0x8AC5B70: unresponsive_fade_frame (shell.c:374)
==2418==    by 0x409FE0: weston_output_finish_frame (compositor.c:1060)
==2418==    by 0x567043B: wl_event_loop_dispatch (event-loop.c:389)
==2418==    by 0x566E84C: wl_display_run (wayland-server.c:1003)
==2418==    by 0x4055EB: main (compositor.c:2937)
==2418==  Address 0x8aba650 is 80 bytes inside a block of size 656 free'd
==2418==    at 0x4A0662E: free (vg_replace_malloc.c:366)
==2418==    by 0x566D93B: wl_resource_destroy (wayland-server.c:408)
==2418==    by 0x566D30E: destroy_resource (wayland-server.h:166)
==2418==    by 0x566D93B: wl_resource_destroy (wayland-server.c:408)
==2418==    by 0x34ECE05D63: ffi_call_unix64 (unix64.S:75)
==2418==    by 0x34ECE05784: ffi_call (ffi64.c:486)
==2418==    by 0x5671AAE: wl_closure_invoke (connection.c:770)
==2418==    by 0x566DBAA: wl_client_connection_data (wayland-server.c:255)
==2418==    by 0x5670497: wl_event_loop_dispatch (event-loop.c:410)
==2418==    by 0x566E84C: wl_display_run (wayland-server.c:1003)
==2418==    by 0x4055EB: main (compositor.c:2937)a

and

==2418== Invalid read of size 8
==2418==    at 0x34F1E180E1: pixman_region32_union (pixman-region.c:1405)
==2418==    by 0x407F66: weston_surface_damage (compositor.c:551)
==2418==    by 0x409FE0: weston_output_finish_frame (compositor.c:1060)
==2418==    by 0x567043B: wl_event_loop_dispatch (event-loop.c:389)
==2418==    by 0x566E84C: wl_display_run (wayland-server.c:1003)
==2418==    by 0x4055EB: main (compositor.c:2937)
==2418==  Address 0x851dfe8 is 136 bytes inside a block of size 680 free'd
==2418==    at 0x4A0662E: free (vg_replace_malloc.c:366)
==2418==    by 0x566D93B: wl_resource_destroy (wayland-server.c:408)
==2418==    by 0x34ECE05D63: ffi_call_unix64 (unix64.S:75)
==2418==    by 0x34ECE05784: ffi_call (ffi64.c:486)
==2418==    by 0x5671AAE: wl_closure_invoke (connection.c:770)
==2418==    by 0x566DBAA: wl_client_connection_data (wayland-server.c:255)
==2418==    by 0x5670497: wl_event_loop_dispatch (event-loop.c:410)
==2418==    by 0x566E84C: wl_display_run (wayland-server.c:1003)
==2418==    by 0x4055EB: main (compositor.c:2937)
2012-05-21 13:59:00 -04:00
Tiago Vignatti 491bac19c7 shell: Expose set_transient in shell interface 2012-05-18 16:37:43 -04:00
Kristian Høgsberg 938b8fa3c2 shell: Expose surface move functionality in shell interface 2012-05-18 13:47:15 -04:00
Daniel Stone 37816df646 Convert wl_input_device to wl_seat (and friends)
wl_input_device has been both renamed and split.  wl_seat is now a
virtual object representing a group of logically related input devices
with related focus.

It now only generates one event: to let clients know that it has new
capabilities.  It takes requests which hand back objects for the
wl_pointer, wl_keyboard and wl_touch interfaces it exposes which all
provide the old input interface, just under different names.

This commit tracks these changes in weston and the clients, as well as
similar renames (e.g. weston_input_device -> weston_seat).  Some other
changes were necessary, e.g. renaming the name for the visible mouse
sprite from 'pointer' to 'cursor' so as to not conflict.

For simplicity, every seat is always exposed with all three interfaces,
although this will change as time goes on.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-16 15:29:06 -04:00
Scott Moreau dc549932b7 Convert wl_fixed_t to int in weston_output_update_zoom().
This way, we don't have to use wl_fixed_to_int() for each
call to weston_output_update_zoom(). It accepts wl_fixed_t
types and converts internally.
2012-05-16 11:04:04 -04:00
Kristian Høgsberg 88c1607fb7 shell: Remove lock/unlock listeners on shutdown 2012-05-16 08:04:19 -04:00
Kristian Høgsberg b71302e1db Fix a few -pedantic warnings
We're not enabling -pedantic by default, but a quick test brought up a few
issues that we should fix.
2012-05-10 14:11:44 -04:00
Daniel Stone 103db7fb56 Convert wire input co-ordinates to fixed-point
To add greater precision when working with transformed surfaces and/or
high-resolution input devices.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-08 14:41:01 -04:00
Tiago Vignatti 52e598cf51 shell: use own struct for transient surfaces
No functional changes; it's only opening space for modifications coming along
on the next commits.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-05-07 16:54:53 -04:00
Tiago Vignatti 70e5c9cc42 shell: fix uninitialized variable warning
and shut-up valgrind:
 Conditional jump or move depends on uninitialised value(s)
    at 0xB5AFB05: shell_surface_configure (shell.c:2162)
    by 0x407B0C: surface_attach (compositor.c:1225)
    by 0x621FA13: ffi_call_unix64
    by 0x621F434: ffi_call
    by 0x4E3D3F5: wl_closure_invoke (connection.c:758)
    by 0x4E3786C: wl_client_connection_data (wayland-server.c:255)
    by 0x4E3AA19: wl_event_source_fd_dispatch (event-loop.c:78)
    by 0x4E3B533: wl_event_loop_dispatch (event-loop.c:460)
    by 0x4E38D2C: wl_display_run (wayland-server.c:907)
    by 0x40B5DD: main (compositor.c:2748)

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-05-07 16:54:32 -04:00
Daniel Stone e5a0120757 Rename 'state' in axis (or ambiguous) bindings to 'value'
Since it's usually an axis value rather than a boolean, be slightly more
explicit about it.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-07 13:03:48 -04:00
Daniel Stone da5b93c8d7 Change key/button grab bindings to take unsigned state
'state' here meaning 'is it up or down?', obviously.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-07 12:54:14 -04:00
Kristian Høgsberg e7afd919c9 shell: Handle set_title and set_class 2012-05-02 09:47:44 -04:00
Kristian Høgsberg f7e23d5c88 shell: Always configure when surface type changes
We can drop the force_configure hack.
2012-04-27 17:51:59 -04:00
Kristian Høgsberg 7f366e7053 shell: Don't move or reconfigure surfaces until we get the new buffer
Going from fullscreen to toplevel will restore the surface position
immediately.  This will move the fullscreen surface to where the toplevel
surface was before, which will flicker for a frame of two before the
resized, non-fullscreen buffer is attached.

Instead, only change the surface geometry when we get the new buffer.
2012-04-27 17:49:40 -04:00
Alex Wu 7bcb8bd30e shell: Fix not remove rotation for fullscreen surf
Remove rotation when entering fullscreen and restore rotation when exiting.

https://bugs.freedesktop.org/show_bug.cgi?id=48906
2012-04-27 15:10:37 -04:00
Ander Conselvan de Oliveira fb9808993b shell: allocate enough memory for shsurf->ping_timer 2012-04-27 15:06:18 -04:00
Juan Zhao e10d279017 shell-animation: add conf option in shell
Now we can choose zoom or fade in weston.ini
to fulfill and customize the user experence easier.

Signed-off-by: Juan Zhao <juan.j.zhao@intel.com>
2012-04-25 10:38:19 -04:00
Kristian Høgsberg ca535c1998 shell: Don't ping internal shell surfaces
This is a hack for now to get xserver surfaces working again.
2012-04-21 23:21:33 -04:00
Tiago Vignatti bc052c99f9 compositor: introduce internal shell_interface
We're able now to create shell_surfaces inside Weston. This makes possible the
glue needed between shell and xserver-launcher.

On the desktop-shell, it was split the protocol part from shell_surface
specific functions to make this possible.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-04-21 23:21:08 -04:00
Kristian Høgsberg a4e8b33704 shell: Move binding-modifier to shell section 2012-04-20 16:48:21 -04:00
Tiago Vignatti 0b52d4810d shell: modifier bindings configurable
This patch makes the main modifier configurable.  We used to hardcode super
(windows key) for most bindings, but now that can be changed.

The change affects two key bindings: rotation moves to mod+right click
and backlight moves to from ctrl+f9/f10 to mod+f9/f10.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-04-20 16:38:35 -04:00
Scott Moreau 9521d5e553 shell: Cleanup ping_timer code.
- Added ping_timer_destroy() to simplify cleanup.
 - Changed timeout and fade step to more realistic values.
 - Renamed ping_timeout_fade_frame() to unresponsive_fade_frame().
2012-04-19 15:12:43 -04:00
Scott Moreau c3e54eb8f0 Dim unresponsive windows
If a client is not responding, lower the brightness and
saturation to indicate it's stalled. The surface is restored
to it's original color values if the client later becomes
responsive.
2012-04-19 12:51:01 -04:00
Scott Moreau ff1db4a4f3 Install structuring for ping-pong protocol 2012-04-19 12:50:47 -04:00
Alex Wu bd3354b8b2 shell: Implement "driver" method of fullsceen.
Switching display mode may happen when:
1. The fullscreen surface is at top most in fullscreen layer and with
   "driver" method. Shell will switch output mode to match the surface
   size. If no matched mode found, fall back to "fill" method.
2. The top fullscreen surface is destroyed or unset. Switch back to the
   origin mode.
2012-04-17 14:38:45 -04:00