summaryrefslogtreecommitdiff
path: root/src/shell.c
AgeCommit message (Collapse)AuthorFilesLines
2013-08-28shell: Make sure we have seat->pointer and seat->touch before dereferencingKristian Høgsberg1-3/+5
Either of these may not be available when we handle wl_shell_surface.move, and we need to not crash when that's the case. https://bugs.freedesktop.org/show_bug.cgi?id=68649
2013-08-20Add touch support for wl_shell_surface_moveRusty Lynch1-7/+121
2013-07-25shell: Remove redundant weston_pointer field from shell_grabKristian Høgsberg1-4/+1
This is already in weston_grab.
2013-07-12shell: Respect output transformation for input panel surfaceRob Bradford1-5/+2
Rather than using the dimensions in the mode we can use the recently added output width and height members which are updated to reflect any output rotation. https://bugs.freedesktop.org/show_bug.cgi?id=66798
2013-07-09Convert to wl_global_create/destroy()Kristian Høgsberg1-9/+9
2013-07-04shell: Always go through end_busy_cursor when ending the busy cursor grabKristian Høgsberg1-4/+5
2013-07-03shell: Dont set grab cursor if desktop-shell client diedKristian Høgsberg1-3/+7
If we don't have a desktop-shell helper client, don't try to send events to it. https://bugs.freedesktop.org/show_bug.cgi?id=65961
2013-07-03shell: Allow ending of popup grabs from within the starting of the grabRob Bradford1-1/+3
Calling weston_pointer_start_grab can lead to a code path (in this case when the shell surface is unresponsive) that can try and remove the popup grab to setup a shell grab. Ending the popup grab requires removing the surface from the grab's surfaces list - however the grab had not yet been fully setup so the grabbed surface was not yet in this list. With this change we ensure we add the surface to the list before setting up the pointer grab. https://bugs.freedesktop.org/show_bug.cgi?id=66167
2013-07-03shell: Fix calculation of center point in surface rotationLouis-Francis Ratté-Boulianne1-2/+2
Make sure the center point of a rotation is not rounded to an integer. It makes the calculation consistent with others in the shell. It also ensures surfaces rotated 180 degrees are at the exact same place.
2013-07-03Use wl_resource_create() for creating resourcesJason Ekstrand1-31/+37
This commit sets the version numbers for all added/created objects. The wl_compositor.create_surface implementation was altered to create a surface with the same version as the underlying wl_compositor. Since no other "child interfaces" have version greater than 1, they were all hard-coded to version 1. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-25compositor: Fix remaining double free()sKristian Høgsberg1-4/+0
Previous commit didn't catch all double free()s, hopefully this one does.
2013-06-20shell: Free temporary stringsQuentin Glidic1-0/+2
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2013-06-17shell: Tweak spring animation for zoom animation typeKristian Høgsberg1-1/+1
2013-06-17shell: Fix warning and indentation in shell_surface_configure()Kristian Høgsberg1-2/+2
2013-06-17spring: Tweak the window fade-in spring to not overshootKristian Høgsberg1-4/+3
The fade animation overshoots and rings for a bit dipping back into slightly transparent. Bug 61675 was right. https://bugs.freedesktop.org/show_bug.cgi?id=61675
2013-06-14output: Use wl_resource_get accessors for weston_output resourcesJason Ekstrand1-6/+6
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-14input: Use wl_resource_get accessor functions for resourcesJason Ekstrand1-3/+3
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-14input_panel_surface: Change resource to a wl_resource pointerJason Ekstrand1-17/+21
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-14shell: Convert resources to pointersJason Ekstrand1-63/+63
This commit converts shell_surface.resource to a pointers and updates shell.c to use wl_resource_get accessors for shell_surface, desktop_shell, screensaver, and workspace_manager related resources. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-14Use wl_resource_get_user_data for weston_surface resourcesJason Ekstrand1-9/+16
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2013-06-14xwayland: Forward global position to XTiago Vignatti1-1/+23
xeyes works as expected now. subwindows are popped also as expected. This patch should fix the following: https://bugs.freedesktop.org/show_bug.cgi?id=59983 Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2013-06-12Change weston_surface.resource to a wl_resource pointer.Jason Ekstrand1-7/+6
This is the first in what will be a series of weston patches to convert instances of wl_resource to pointers so we can make wl_resource opaque. This patch handles weston_surface and should be the most invasive of the entire series. I am sending this one out ahead of the rest for review. Specifically, my machine is not set up to build XWayland so I have no ability to test it fully. Could someone please test with XWayland and let me know if this causes problems? Because a surface may be created from XWayland, the resource may not always exist. Therefore, a destroy signal was added to weston_surface and everything used to listen to surface->resource.destroy_signal now listens to surface->destroy_signal.
2013-06-05configure.ac: Enable AC_USE_SYSTEM_EXTENSIONSDaniel Stone1-0/+2
AC_USE_SYSTEM_EXTENSIONS enables _XOPEN_SOURCE, _GNU_SOURCE and similar macros to expose the largest extent of functionality supported by the underlying system. This is required since these macros are often limiting rather than merely additive, e.g. _XOPEN_SOURCE will actually on some systems hide declarations which are not part of the X/Open spec. Since this goes into config.h rather than the command line, ensure all source is consistently including config.h before anything else, including system libraries. This doesn't need to be guarded by a HAVE_CONFIG_H ifdef, which was only ever a hangover from the X.Org modular transition. Signed-off-by: Daniel Stone <daniel@fooishbar.org> [pq: rebased and converted more files]
2013-05-29shell: Position DRIVER fullscreen surfaces at originAlexander Larsson1-0/+3
When a window is fullscreened with DRIVER method and we succeeded in changing mode we need to actually move the surface to the origin of the output, or it won't be used for scanout.
2013-05-28shell: Center window in fullscreen if neededAlexander Larsson1-1/+4
If modeset fails With DRIVER method, and always with FILL method we want to center the window.
2013-05-28shell: Always go to original mode when focused window not fullscreenAlexander Larsson1-9/+29
Right now we only switch mode on activating a fullscreened window. This has several problems: * Once you're in fullscreen its hard to switch to a non-fullscreened window with alt-tab as you stay in the small resolution. * If you switch from a fullscreened window to a non-fullscreened window and the fullscreened window is destroyed we will not restore the original mode (since the window is not shell_surface_is_top_fullscreen() * Its hard to reach a different output on the right with the mouse when the mode is smaller that the original, as there is a "gap" between the two outputs. So, if you alt-tab to another window you can not always reach it. This is somewhat of a sledge hammer, as it means you can't e.g. focus a non-fullscreen on one output and have a window fullscreened on another output. However, trying to restore only the outputs the new window is on is problematic: * It may later change output * We want to see all windows anyway during alt-tab * Can't reach the other windows with the mouse anyway So, this seems like an ok solution.
2013-05-28shell: Use buffer_scale as output scale on fullscreen DRIVERAlexander Larsson1-5/+7
It may happen that you e.g. fullscreen a 800x600 surface with buffer_scale 1 (e.g. a 800x600 buffer) on an output that is otherwise scale 2. In this case we want to temporarily set the output scale to 1, as we're really scanning out of a scale 1 buffer. This causes us to e.g. report the input positions in the right place, etc. When we restore the original mode we also restore the original scale. Note that the scale change is a purely compositor internal change, to clients it still looks like the output is scale 2.
2013-05-26compositor: Parse config file in main(), only keep weston config objectKristian Høgsberg1-2/+2
Now that all backends and modules have been converted to the new config parser API, we don't have to keep the fd around.
2013-05-23shell: Remove input panel debug fprintfKristian Høgsberg1-4/+0
2013-05-23shell: Use new config parserKristian Høgsberg1-29/+20
2013-05-22shell: wait for desktop-shell init before fade inPekka Paalanen1-14/+105
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-22compositor: add capability flag for arbitrary surface rotationPekka Paalanen1-2/+5
The upcoming rpi-renderer cannot handle arbitrary rotations. Introduce Weston capability bits, and add a bit for arbitrary rotation. GL and Pixman renderers support it. Shell or any other module must not produce surface transformations with rotation, if the capability bit is not set. Do not register the surface rotation binding in desktop shell, if arbitary rotation is not supported. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2013-05-20shell: End grab if the grabbed shell surface has been destroyedRob Bradford1-1/+1
The shell_grab_start function sets up a destroy notification on the shell surface such that when the shell surface is destroyed the pointer on the grab to the shell surface is set to NULL. We must therefore check whether the shell surface is NULL and end the grab if it is. https://bugs.freedesktop.org/show_bug.cgi?id=64689
2013-05-17Fix surface_pong when a seat doesn't have a pointerHardening1-2/+4
This patch fixes a crash with the surface_pong when one of the seats doesn't have a pointer. This was the case with the RDP compositor that use a fake seat with no mouse or keyboard.
2013-05-14lock-surface: Set geometry width and height before centeringKristian Høgsberg1-0/+2
The subsurface patches changed the center_on_output() behavior a bit. Instead of using the buffer width and height, it now looks at surface geometry. In lock_surface_configure() we haven't set up the geometry when we call center_on_output() so the lock surface would never show up.
2013-05-14config-parser: Honor XDG_CONFIG_DIRSOssama Othman1-4/+4
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-10shell: account for the subsurfaces when going fullscreen or maximizingGiulio Camuffo1-21/+68
We must calculate the bounding box of the surface + subsurfaces set and use that when maximizing the window or going fullscreen. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10shell: enable moving and resizing of a surface when clicking on a subsurfaceGiulio Camuffo1-2/+6
[pq: changed to weston_surface_get_main_surface(), and used a temporary variable to clean up the expressions.] Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-10shell: keyboard focus and restacking fixes for sub-surfacesPekka Paalanen1-18/+48
The shell needs to redirect some actions to the parent surface, when they originally target a sub-surface. This patch implements the following: - Move, resize, and rotate bindings always target the parent surface. - Opacity (full-surface alpha) binding targets the parent surface. This is broken, because it should change the opacity of the whole compound window, which is difficult to implement in the renderer. - click_to_activate_binding() needs to check the shell surface type from the main surface, because sub-surface would produce SHELL_SURFACE_NONE and prevent activation. - Also activate() needs to check the type from the main surface, and restack the main surface. Keyboard focus is assigned to the original (sub-)surface. - focus_state_surface_destroy() needs to handle sub-surfaces: only the main surface will be in a layer list. If the destroyed surface is indeed a sub-surface, activate the main surface next. This way a client that destroys a focused sub-surface still retains focus in the same window. - The workspace_manager.move_surface request can accept also sub-surfaces, and it will move the corresponding main surface. Changes in v2: - do not special-case keyboard focus for sub-surfaces - fix surface type checks for sub-surfaces in shell, fix restacking of sub-surfaces in shell, fix focus_state_surface_destroy() Changes in v3: - Renamed weston_surface_get_parent() to weston_surface_get_main_surface() to be more explicit that this is about sub-surfaces - Fixed move_surface_to_workspace() to handle keyboard focus on a sub-surface. - Used a temporary variable in several places to clarify code, instead of reassigning a variable. - Fixed workspace_manager_move_surface() to deal with sub-surfaces. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2013-05-08input: Move surface picking into the pointer grab focus callbackKristian Høgsberg1-9/+17
Currently the core input code does surface picking before calling into the focus callback of the current grab. Not all grabs need to pick a surface however, so we're doing work we don't have to in those cases. For example, the shell move and resize grabs don't need to pick and the default grab in implicit grab mode doesn't either. With this change, the pointer grab mechanism is now very simple: the focus callback is called whenever the pointer may have a new focus, the motion callback is called whenever the pointer moves and the button callback whenever a button is pressed or released.
2013-05-08input: Get rid of grab focus conceptKristian Høgsberg1-19/+14
This was another complication that we had to have to support the split between libwayland-server and weston. Different grabs want to send events relative to different surfaces at different times. The default grab switches between sending coordinates relative to the 'current' surface, that is the surface the pointer is currently above, or the 'clicked' surface, in case of an implicit grab. The grab focus was set by the grab implementation and the core input code would transform the pointer position to surface relative coordinates for the grab focus and store in grab->x/y. Now we can just let the grab implementation transform the pointer coordinates itself, leaving the implementation free to transform according to whichever surface it wants. Or not transform at all if it doesn't need surface relative coordinates (like the shell move and resize grabs).
2013-05-08input: Remove 'current' and related fields from weston_pointerKristian Høgsberg1-18/+5
The current surface field was used to track the surface the pointer was currently over along with pointer position relative to that surface, regardless of implicit or explicit grabs. The main purpose was to restore the default grab when another grab terminated. We can now just repick in that case and avoid keeping that state around, with the destroy listener overhead that involves. There was one other use case - we used to optimize out calls to weston_pointer_set_focus() if the focus didn't actually change. We can still do that, but we have to do that in the default_grab_focus() handler and compare against weston_pointer->focus instead.
2013-05-08compositor: Adapt to wl_surface going awayKristian Høgsberg1-25/+20
struct weston_surface is now the only surface type we have (in core, shell.c has shell_surface, of course). A lot of code gets simpler and we never have to try to guess whether an API takes a wl_surface or a weston_surface.
2013-05-07input: Eliminate weston_seat::has_pointer/keyboard/touchKristian Høgsberg1-2/+2
We can just look at weston_seat::pointer/keyboard/touch now.
2013-05-07compositor: Move fan_debug to gl-rendererKristian Høgsberg1-12/+0
With the debug binding infrastructure, we can do this all inside gl-renderer.c.
2013-05-07input: Merge wl_seat into weston_seatKristian Høgsberg1-58/+56
2013-05-06input: Remove wl_seat destroy signalKristian Høgsberg1-1/+1
We already have one on weston_seat.
2013-05-06input: Rename wl_pointer to weston_pointerKristian Høgsberg1-51/+51
This is now a weston object.
2013-05-06fold wl_keyboard into weston_keyboardKristian Høgsberg1-23/+21
2013-05-02text: Rename input_method to wl_input_methodJan Arne Petersen1-6/+6
Also rename input_method_context to wl_input_method_context, input_panel to wl_input_panel and input_panel_surface to wl_input_panel_surface. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>