Commit graph

175 commits

Author SHA1 Message Date
Kristian Høgsberg 9e31bff831 shell: Move surface move code back to just after the move grab functions
This chunk of code is what uses the move grab and used to come right
after it.  At some point it got split up, but move it back now.
2012-08-01 00:08:07 -04:00
Kristian Høgsberg 64eca8949b compositor: Fold the log prototypes into compositor.h and drop log.h
We're trying to keep the API exposed by the core compositor in compositor.h
2012-08-01 00:00:57 -04:00
Kristian Høgsberg e377822c64 shell: Give keyboard focus to top surface when current keyboard focus goes away 2012-07-31 22:18:02 -04:00
Kristian Høgsberg 2f5faff7f9 shell: Always track focus state per workspace
It's a little simpler than always creating and destroying it when we
switch workspace, and we'll need the focus_state soon.
2012-07-31 16:36:37 -04:00
Kristian Høgsberg c94de6450e shell: Remove unused shsurf->focus_state 2012-07-31 10:51:22 -04:00
Kristian Høgsberg b8e0d0f5ac shell: Use the right destroy listener in focus_state_surface_destroy()
We were dereferencing the seat destroy listener.
2012-07-31 10:30:26 -04:00
Tiago Vignatti 65191d144f shell: Remove unused pointer_end_grab
shell_grab_end already does that for us.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-07-20 15:31:52 -04:00
Kristian Høgsberg a08b528597 shell: Center fullscreen surface whenever new buffer is attached 2012-07-20 15:31:00 -04:00
Kristian Høgsberg 82a1d11cfa shell: Set shell_interface.shell at initialization 2012-07-19 14:02:49 -04:00
Kristian Høgsberg 94de680439 shell: Default to maximize/fullscreen on current output 2012-07-18 15:52:13 -04:00
Ander Conselvan de Oliveira eac9a46012 shell: Don't ping the grab surface
If the grab surface happens to be unresponsive, the busy cursor grab
will be started and that will cause the grab surface to receive focus,
which in turn leads to it being pingged again. Break the cycle by not
sending pings to it. If the shell is unresponsive it won't be able to
set the busy cursor anyway.
2012-07-16 13:35:25 -04:00
Kristian Høgsberg 240dfeb0fe shell: Scale fullscreen surface without cropping them, center on output 2012-07-12 12:32:31 -04:00
Juan Zhao 4ab9468865 shell: Use the correct the member name when iterating panel_list
It does not get the correct panel height for now.  The memeber of list
to read should be layer_link not link now.

Signed-off-by: Juan Zhao <juan.j.zhao@linux.intel.com>
2012-07-10 08:47:25 -04:00
Kristian Høgsberg e4d3a2bce6 Only position fullscreen surface in surface->configure callback
We end up calling shell_configure_fullscreen() from activate(), where
surface->buffer may be NULL.  Instead, call it on initial map and
first buffer attach after surface type change.  Both code path
come from the surface->configure callback where surface->buffer is know
to be non-NULL.

https://bugs.freedesktop.org/show_bug.cgi?id=51678
2012-07-09 21:49:10 -04:00
Rob Bradford 31b6862eeb shell: Use desired output when sending configure events when maximised
With shell_surface.set_maximised the caller can provide an output to maximise
to or the default output will be used. With the corresponding configure we
should use the dimensions from the chosen output not the output the surface
was currently on.

Similarly when calculating the position for the window in the map() function
we should use the desired output again.

There is no need to assign shsurf->output to es->output since that happens in
the map() function later.
2012-07-02 15:16:19 -04:00
Ander Conselvan de Oliveira 00d17bb903 shell: Don't move fullscreen surfaces 2012-06-28 14:14:01 -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 73694c832b compositor: Move repaint debug binding to mod-shift-space
Alt-space or Super-space are too likely to conflict with application
bindings.
2012-06-28 14:13:10 -04:00
Kristian Høgsberg c7cd626bcf compositor: Update xkb state with key releases on focus out
This happens when vt-switching away from the compositor (drm) or
giving keyboard focus to a different X window.  Release the modifiers
so we don't get stuck modifiers.  We'll update with the new keys down
when we come back.
2012-06-28 13:46:09 -04:00
Kristian Høgsberg 8150b190d6 shell: Take a wl_surface as parent for transient and popup windows 2012-06-27 10:24:22 -04:00
Kristian Høgsberg 0636ac307e shell: Make input_panel just a regular wl_surface 2012-06-27 10:24:21 -04:00
Kristian Høgsberg 1a73a6335d shell: Make screensaver just a wl_surface 2012-06-27 10:24:21 -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
Kristian Høgsberg ce345b0f60 shell: Fix inverted test for locked in workspace bindings 2012-06-25 21:35:42 -04:00
Kristian Høgsberg 4476aaff24 shell: Hide workspace layer when locking screen 2012-06-25 14:03:13 -04:00
Kristian Høgsberg 1ce6a2a2b3 shell: Animate input panel mapping
We slide it in from below.
2012-06-21 22:34:39 -04:00
Kristian Høgsberg 414bd420fd util: Generalize surface animation code
Too much duplicated code here, and we're about to introduce another
animation.
2012-06-21 22:07:30 -04:00
Kristian Høgsberg 85b2e4b6bf shell: Don't focus to background, screensaver or input_panel surfaces 2012-06-21 16:49:42 -04:00
Kristian Høgsberg a4a4de487e shell: Don't allow move/resize/rotate for input panel surfaces 2012-06-21 16:46:14 -04:00
Jan Arne Petersen 42feced8de shell: Add support for input panels 2012-06-21 16:41:06 -04:00
Kristian Høgsberg d813445f16 shell: Just use surface->private for shell_surface 2012-06-21 12:49:02 -04:00
Kristian Høgsberg 6c6fb993f7 shell: Schedule repaint when moving a surface
It seems we used to rely on the repaint scheduled by the cursor motion.
But if there's no cursor, there's no cursor motion, so we need to schedule
our own repaint.
2012-06-21 12:32:23 -04:00
Kristian Høgsberg b0d8e779df switcher: Don't use compositor->surface_list
compositor->surface_list is only valid during weston_output_repaint() so
don't use it in the switcher code.
2012-06-18 16:34:58 -04:00
Scott Moreau 8dacaaba1b Animate transitions for zoom focus point change.
Handle the transition when focus changes from text cursor to
mouse pointer or vice versa.
2012-06-18 11:07:03 -04:00
Kristian Høgsberg 7b5029f8d4 shell: Don't override the sprite surface output
This was a hack to force the sprite surface to have an output.  Not needed
not that the sprite surface is a regular client provided surface.
2012-06-15 16:31:27 -04:00
Jonas Ådahl 04769744e1 shell: Store focus state in workspaces
When moving moving back to a workspace or resuming a locked desktop the
keyboard focus state information was lost. By pushing the state to the
workspace when navigating away from a workspace, or locking a desktop,
we can restore it when navigating back, or resuming.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-06-12 20:20:38 -04:00
Jonas Ådahl 62fcd0417e shell: Animate workspace changes
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-06-12 20:20:30 -04:00
Jonas Ådahl e3cddce5a6 shell: Virtual workspaces
A workspace is a list of top level surfaces visible at a time. New
toplevel surfaces are added to the current workspace. Default
keybindings (modifier - Up, modifier - Down, modifier - F1 up to F6) are
used for navigating between workspaces. By default a single workspace is
created.

Surfaces of inactive workspaces have their outputs NULL:ed so that frame
callbacks gets queued instead of emitted. When workspace gets visible
again surface's outputs are assigned.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-06-12 20:20:22 -04:00
Scott Moreau e6603981da Implement animated transitions for zoom in/out. 2012-06-11 23:45:25 -04:00
Martin Minarik 6d11836721 Replace fprintf() by weston_log() 2012-06-08 13:11:36 -04:00
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