summaryrefslogtreecommitdiff
path: root/desktop-shell
Commit message (Collapse)AuthorAgeFilesLines
...
* desktop-shell: Make surface_touch_move take a touch instead of a seatDerek Foreman2015-07-161-6/+6
| | | | | | | | | It never actually needs the seat, and we always verify the touch pointer before calling it, so let's just pass a touch pointer instead of having an assumption that the seat's touch pointer has been verified. Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* input: Pass the appropriate pointer type to bindings instead of a seatDerek Foreman2015-07-163-63/+68
| | | | | | | | | | | | | | | | | Normally we need to check if a seat's [device_type]_count is > 0 before we can use the associated pointer. However, in a binding you're guaranteed that the seat has a device of that type. If we pass in that type instead of the seat, it's obvious we don't have to test it. The bindings can still get the seat pointer via whatever->seat if they need it. This is preparation for a follow up patch that prevents direct access to seat->device_type pointers, and this will save us a few tests at that point. Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* exposay: Test keyboard presence before using keyboard pointerDerek Foreman2015-07-161-3/+6
| | | | | | | | We shouldn't actually use the keyboard pointer unless we check that a keyboard is present. Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
* desktop-shell: make client_initiated a boolDerek Foreman2015-07-101-6/+6
| | | | | | | Make it a bool in both surface_move() and struct weston_move_grab Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
* desktop-shell: Allow fullscreen windows to mode-switch their output.Mario Kleiner2015-07-021-1/+2
| | | | | | | | | | | | | | | | | | | Fix desktop-shell's activate() method to only restore the output mode on the single output on which a shell surface gets activated. This way toplevel fullscreen surfaces can mode-switch their output via method WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER and that temporary mode properly persists until the surface loses its fullscreen status, but effects like window switching and exposay still work in the expected way. v2: Split into a separate patch from original patch "Allow restore_output_mode() to work properly.", as suggested by Derek Foreman. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Cc: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* desktop-shell: Allow multiple active fullscreen windows on multi-display setup.Mario Kleiner2015-06-303-14/+38
| | | | | | | | | | | | | | | | | | | | | | | Desktop shell demoted all fullscreen shell surfaces on all active outputs of a multi-display setup whenever any shell surface was activated anywhere. This made it impossible to have multiple fullscreen windows on separate outputs active at the same time, as creating or activating any shell surface would disable fullscreen status for all existing fullscreen surfaces. Make lower_fullscreen_layer() more selective, so on request it only demotes fullscreen surfaces on a specified weston_output. The activate() method for a specific surface will now only request demotion of fullscreen surfaces on the target output of the activated surface, but leave fullscreen surfaces on unrelated outputs alone. Desktop wide acting functions like the window switcher or exposay will still demote all fullscreen surfaces on all outputs to implement their effect as before. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
* text_backend: make destructor call explicitPekka Paalanen2015-06-262-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to rely on the order in which the weston_compositor::destroy_signal callbacks happened, to not access freed memory. Don't know when, but this broke at least with ivi-shell, which caused crashes in random places on compositor shutdown. Valgrind found the following: Invalid write of size 8 at 0xC2EDC69: unbind_input_panel (input-panel-ivi.c:340) by 0x4E3B6BB: destroy_resource (wayland-server.c:537) by 0x4E3E085: for_each_helper.isra.0 (wayland-util.c:359) by 0x4E3E60D: wl_map_for_each (wayland-util.c:365) by 0x4E3BEC7: wl_client_destroy (wayland-server.c:675) by 0x4182F2: text_backend_notifier_destroy (text-backend.c:1047) by 0x4084FB: wl_signal_emit (wayland-server-core.h:264) by 0x4084FB: main (compositor.c:5465) Address 0x67ea360 is 208 bytes inside a block of size 232 free'd at 0x4C2A6BC: free (vg_replace_malloc.c:473) by 0x4084FB: wl_signal_emit (wayland-server-core.h:264) by 0x4084FB: main (compositor.c:5465) Invalid write of size 8 at 0x4E3E0D7: wl_list_remove (wayland-util.c:57) by 0xC2EDEE9: destroy_input_panel_surface (input-panel-ivi.c:191) by 0x4E3B6BB: destroy_resource (wayland-server.c:537) by 0x4E3BC7B: wl_resource_destroy (wayland-server.c:550) by 0x40DB8B: wl_signal_emit (wayland-server-core.h:264) by 0x40DB8B: weston_surface_destroy (compositor.c:1883) by 0x40DB8B: weston_surface_destroy (compositor.c:1873) by 0x4E3B6BB: destroy_resource (wayland-server.c:537) by 0x4E3E085: for_each_helper.isra.0 (wayland-util.c:359) by 0x4E3E60D: wl_map_for_each (wayland-util.c:365) by 0x4E3BEC7: wl_client_destroy (wayland-server.c:675) by 0x4182F2: text_backend_notifier_destroy (text-backend.c:1047) by 0x4084FB: wl_signal_emit (wayland-server-core.h:264) by 0x4084FB: main (compositor.c:5465) Address 0x67ea370 is 224 bytes inside a block of size 232 free'd at 0x4C2A6BC: free (vg_replace_malloc.c:473) by 0x4084FB: wl_signal_emit (wayland-server-core.h:264) by 0x4084FB: main (compositor.c:5465) Invalid write of size 8 at 0x4E3E0E7: wl_list_remove (wayland-util.c:58) by 0xC2EDEE9: destroy_input_panel_surface (input-panel-ivi.c:191) by 0x4E3B6BB: destroy_resource (wayland-server.c:537) by 0x4E3BC7B: wl_resource_destroy (wayland-server.c:550) by 0x40DB8B: wl_signal_emit (wayland-server-core.h:264) by 0x40DB8B: weston_surface_destroy (compositor.c:1883) by 0x40DB8B: weston_surface_destroy (compositor.c:1873) by 0x4E3B6BB: destroy_resource (wayland-server.c:537) by 0x4E3E085: for_each_helper.isra.0 (wayland-util.c:359) by 0x4E3E60D: wl_map_for_each (wayland-util.c:365) by 0x4E3BEC7: wl_client_destroy (wayland-server.c:675) by 0x4182F2: text_backend_notifier_destroy (text-backend.c:1047) by 0x4084FB: wl_signal_emit (wayland-server-core.h:264) by 0x4084FB: main (compositor.c:5465) Address 0x67ea368 is 216 bytes inside a block of size 232 free'd at 0x4C2A6BC: free (vg_replace_malloc.c:473) by 0x4084FB: wl_signal_emit (wayland-server-core.h:264) by 0x4084FB: main (compositor.c:5465) Looking at the first of these, unbind_input_panel() gets called when the text-backend destroys its helper client which has bound to input_panel interface. This happens after the shell's destroy_signal callback has been called, so the shell has already been freed. The other two errors come from wl_list_remove(&input_panel_surface->link); which has gone stale when the shell was destroyed (shell->input_panel.surfaces list). Rather than creating even more destroy listeners and hooking them up in spaghetti, modify text-backend to not hook up to the compositor destroy signal. Instead, make it the text_backend_init() callers' responsibility to also call text_backend_destroy() appropriately, before the shell goes away. This fixed all the above Valgrind errors, and avoid a crash with ivi-shell when exiting Weston. Also using desktop-shell exhibited similar Valgrind errors which are fixed by this patch, but those didn't happen to cause any crashes AFAIK. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
* desktop-shell: remove screensaver supportPekka Paalanen2015-06-222-180/+0
| | | | | | | | | | | | | | | | | | | | | This is a follow-up for the patch that removed weston-screensaver. The aim is to clean up shell.c a little by removing non-essential components. Vanilla Weston desktop is only a demo, external projects are encouraged to create user-friendly desktop environments. The support for launching a screensaver client and the protocol bindings are removed. With them, all related configuration options are removed, and the manuals are updated accordingly. The screensaver protocol definition is left in desktop-shell.xml for posterity. This does not affect Weston's or desktop-shells ability to put screens to sleep after inactivity. The inactivity timer continues to operate as before. Also screen locking is unaffected. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Giulio Camuffo <giuliocamuffo@gmail.com>
* Unified multiple definitions of container_of() macro.Jon Cruz2015-06-152-0/+2
| | | | | | | | | Removed duplicate definitions of the container_of() macro and refactored sources to use the single implementation. Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* Moved the MIN() macro to the helper include.Jon Cruz2015-06-151-0/+1
| | | | | | | | | | Removed multiple definitions of the MIN() macro from existing locations and unified with a single definition. Updated sources to use the shared version. Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* Remove redundant #include path component.Jon Cruz2015-06-151-1/+1
| | | | | | | | | Using the parent '../' path component in #include statements makes the codebase more rigid and is redundant due to proper -I use. Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* *-shell: Update boilerplate from MIT X11 license to MIT Expat licensesBryce Harrington2015-06-154-64/+68
|
* move text_backend initialization into the shell pluginMurray Calavera2015-06-111-0/+3
| | | | | | | | | Whether a input method is used should be the responsibility of the shell because some shells may not want to implement an input method at all Signed-off-by: Murray Calavera <murray.calavera@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* desktop-shell: do not black out with startup "none"Pekka Paalanen2015-05-261-2/+8
| | | | | | | | | | | | | | | | | | | | Do not use a black blanket surface when the startup animation is specified to be "none". This is the final fix needed to make the screenshot test deterministic and independent of weston-desktop-shell. Previously, the black surface would cover all outputs until weston-desktop-shell signalled ready. Then, depending on the set animation, either the black surface was immediately removed (none) or a fade-in started (fade). Now, when there is no black surface at all for "none", the compositor will show garbage until weston-desktop-shell gets everything up. This may be undesireable but works for tests. To have the old "none" behaviour back, I would propose to add a new startup-animation value "black" for it. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
* desktop-shell: destroy surfaces in an idle handler after fade outDerek Foreman2015-05-261-1/+18
| | | | | | | | | | | | | | | | It's possible for more than one animation to be taking place on a view at the same time. If one of those animations is the shell's fade out for dying surfaces, its completion handler will trigger the surface destroy signal, causing other animations on the animation list to remove themselves. Since this removal occurs during the linked list walk, the compositor may crash. We move the actual surface destruction into an idle handler to avoid this. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* exposay: Don't crash if no pointer is presentDerek Foreman2015-05-261-6/+9
| | | | | | | | If the compositor has never seen a mouse, exposay will crash because the seat->pointer pointer is NULL. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* remove trailing whitespacesMichael Vetter2015-05-151-1/+1
| | | | | Remove trailing whitespaces because they are not needed and jumping to the end of al ine should do just that and not jump to the whitespace.
* desktop-shell: set the current size in the first 'resizing' configure eventRyo Munakata2015-05-081-0/+3
| | | | | | | | | Weston has sent the first 'resizing' configure event with width=height=0. But resizing to that size doesn't make sense. Instead, we now send the current width and height of the surface at the beginning of resizing. Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
* xdg-shell: Move xdg_shell.get_xdg_popup errors to xdg_shellJonas Ådahl2015-05-051-19/+19
| | | | | | | | | They are errors that may be as a result of calling get_xdg_popup on an xdg_shell, not a result of calling a request on xdg_popup. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* xdg-shell: Require proper object tree destructionJonas Ådahl2015-05-051-0/+26
| | | | | | | | | | | Require all child objects to be destroyed before the parent. In other words, all popups and surfaces created by one xdg_shell instance needs to be destroyed before the xdg_shell object, otherwise a protocol error is raised. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* touch: Make weston_touch_set_focus() take a touch instead of a seatDerek Foreman2015-05-011-1/+1
| | | | | | | | The other set_focus() functions take the relevant type instead of a seat already, so this is consistent. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
* desktop-shell: Require a popup parent to be a shell surfaceDima Ryazanov2015-04-131-5/+7
| | | | | | | | Currently, the shell crashes if the parent is not a shell surface. Instead, send an error to the client. Signed-off-by: Dima Ryazanov <dima@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* xwm: tell the shell the pid of the X clientsGiulio Camuffo2015-03-301-0/+7
| | | | | | | | | | | All the surfaces from all the X clients share the same wl_client so wl_client_get_credentials can't be used to get the pid of the X clients. The shell may need to know the pid to be able to associate a surface with e.g. a DBus service. [Pekka: fixed trivial merge conflicts.] Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* desktop-shell: remove dead unminimization codeManuel Bachmann2015-03-271-23/+10
| | | | | | | | | The "set_minimized(surface, 0)" function call was never used anywhere, and not really respecting naming conventions. Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* desktop-shell: don't allow negative values in drag resizeDerek Foreman2015-03-181-0/+4
| | | | | | | | Now clamping width and height to a minimum of 1, 1 when drag resizing. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* shell,compositor-x11: Fix trivial memory leaksRyo Munakata2015-03-091-0/+2
| | | | | Signed-off-by: Ryo Munakata <ryomnktml@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor,shell: move debug key code to corePekka Paalanen2015-03-021-130/+1
| | | | | | | | | | | | | | | The code for the key binding that triggers debug key bindings, that is, the code that makes mod+SHIFT+SPACE work, used to live in shell.c. I want to make the debug key bindings available in ivi-shell too, so this code should be shared. Move it to core. The code was originally introduced in commit c509d2b1523364d38da3038eec7b46cd71acd3f5 so update the copyright in binding.c to reflect that. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> Reviewed-by: Daniel Stone <daniels@collabora.com>
* xdg-shell: Bump unstable versionJasper St. Pierre2015-02-271-1/+1
| | | | Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* xdg-shell: Add a simple destructor requestJasper St. Pierre2015-02-271-1/+9
| | | | Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* xdg-shell: Add invalid_parent error to xdg_popupJonas Ådahl2015-02-271-1/+10
| | | | | | | | Send an invalid_parent error when the client tries to create a popup with a paren that is neither a xdg_surface nor a xdg_popup. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* xdg-shell: Send an error when the client uses the not-topmost popupJasper St. Pierre2015-02-271-5/+53
| | | | | | | | | Either in destroy or get_xdg_popup. [jadahl: Verify that the new popup is the top most when mapping instead of creating. Some renaming.] Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* xdg-shell: Remove the flags from get_xdg_popupJasper St. Pierre2015-02-271-1/+1
| | | | | | | | There haven't been any ideas for flags, so we don't need a useless, unused parameter hanging around. Any future ideas should be done with a new request entirely. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* xdg-shell: Remove the serial from popup_doneJasper St. Pierre2015-02-271-2/+1
| | | | | | | It doesn't serve any purpose, as it's a serial that the client gave to the server when starting the popup, which the client already has. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* xdg-shell: Take a xdg_surface as the parent surfaceJasper St. Pierre2015-02-271-6/+6
| | | | | | There is no other valid surface that we should be using here. Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* desktop-shell: Fix coding style of add_popup_grabJonas Ådahl2015-02-231-13/+24
| | | | | Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* desktop-shell: Simplify popup_end_grab popup_done sending loopJonas Ådahl2015-02-231-21/+15
| | | | | | | | Can just use wl_list_for_each_safe instead of dealing with pointers ourself. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* desktop-shell: Fail if get_xdg_surface is called on an xdg_surfaceJonas Ådahl2015-02-061-0/+16
| | | | | | | | | | | | | | | | If a client calls xdg_shell.get_xdg_surface on a surface that is already an xdg_surface would, prior to this patch, succeed, but cause weston to crash later when trying to configure. This patch instead sends a role error to the client complaining that it already is an xdg_surface. Note that .._set_role() only fails when changing roles, not when setting the same role twice. The same is done for xdg_popup. Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* xwm: support maximizing xwayland windowsGiulio Camuffo2015-02-021-26/+46
| | | | | | | | | | | | This patch adds the maximize button to the window frame for the windows which set the MWM_DECOR_MAXIMIZE hint, and it wires it with the shell via a new method in weston_shell_interface. Additionally, it also listens for the wm hints coming from the client, but it doesn't support maximizing a window only vertically or horizontally. The window will be maximized only when both directions are maximized. Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* desktop-shell: Remove unnecessary type castsDerek Foreman2015-02-021-8/+7
| | | | | | | Remove a few instances of casting weston_seat to weston_seat. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
* desktop-shell: Don't crash on zoom without a pointer in the seatDerek Foreman2015-01-301-0/+5
| | | | | | | | | | The zoom effect zooms at the seat's current pointer location. When no pointer is present the zoom key bindings cause a crash. Instead, check for the absence of a pointer and log a warning. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
* shell: fix positioning of maximized surfaces with a custom geometryGiulio Camuffo2015-01-271-2/+7
|
* compositor: Implement JSON-timeline loggingPekka Paalanen2014-12-081-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Logging is activated and deactivated with the debug key binding 't'. When activated, it creates a new log file, where it records the events. The log file contains events and detailed object information entries in JSON format, and is meant to be parsed in sequence from beginning to the end. The emitted events are mostly related to the output repaint cycle, like when repaint begins, is submitted to GPU, and when it completes on a vblank. This is recorded per-output. Also some per-surface events are recorded, including when surface damage is flushed. To reduce the log size, events refer to objects like outputs and surfaces by id numbers. Detailed object information is emitted only as needed: on the first object occurrence, and afterwards only if weston_timeline_object::force_refresh asks for it. The detailed information for surfaces includes the string returned by weston_surface::get_label. Therefore it is important to set weston_timeline_object::force_refresh = 1 whenever the string would change, so that the new details get recorded. A rudimentary parser and SVG generator can be found at: https://github.com/ppaalanen/wesgr The timeline logs can answer questions including: - How does the compositor repaint cycle work timing-wise? - When was the vblank deadline missed? - What is the latency from surface commit to showing the new content on screen? - How long does it take to process the scenegraph? v2: weston_surface::get_description renamed to get_label. v3: reafctor a bit into fprint_quoted_string(). Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor: add weston_surface_set_label_func()Pekka Paalanen2014-12-082-0/+102
| | | | | | | | | | | | | | | | | | | | When printing out logs from Weston's actions, mainly for debugging, it can be very difficult to identify the different surfaces. Inspecting the configure function pointer is not useful, as the configure functions may live in modules. Add vfunc get_label to weston_surface, which will produce a short, human-readable description of the surface, which allows identifying it better, rather than just looking at the surface size, for instance. Set the label function from most parts of Weston, to identify cursors and drag icons, and panels, backgrounds, screensavers and lock surfaces, and the desktop shell's application surfaces. v2: renamed 'description' to 'label', so we get weston_surface_set_label_func(). Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* desktop-shell: don't crash input-panel if no kbd focusPekka Paalanen2014-11-241-1/+1
| | | | | | | | | | | | | | | | If a keyboard exists but it has no current focus, yet something asks the input-panel to come up, we would crash here. Check that there is a focus before attempting to use it. Maybe there should not even exist a case where input-panel tries to come up without a keyboard focus, but I am not sure there is no race where it could happen. In any case, this fix was brought up by the ivi-shell work, where I suppose you can somehow hit it. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Cc: Tanibata, Nobuhiko <ntanibata@jp.adit-jv.com>
* xwayland: fix fullscreeningMarek Chalupa2014-11-211-2/+2
| | | | | | | | | | | | set_fullscreen has been sending configure before changing the state and xwayland windows added border to the fullscreen size. This fixes the bug: https://bugs.freedesktop.org/show_bug.cgi?id=83502 Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Ryo Munakata <ryomnktml@gmail.com> Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor: Refactor weston_output_mode_switch()Derek Foreman2014-11-051-8/+4
| | | | | | | | | | | | | | This breaks weston_output_mode_switch() into 3 functions: weston_output_mode_set_native() weston_output_mode_switch_to_temporary() weston_output_mode_switch_to_native() Differences from previous behaviour: SET_NATIVE didn't set current_scale (now it does) SET_TEMPORARY could set mode and scale independently - now it can't. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* compositor: send error for surface role resetsPekka Paalanen2014-10-081-28/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the more accurate definition of wl_surface roles in Wayland, enforce the restriction: a role is always set permanently, and attempting to change it is a protocol error. This patch is based on Jasper's patch: http://lists.freedesktop.org/archives/wayland-devel/2014-August/016811.html The difference in this patch compared to his are: - send role errors on the interface whose request triggers it, not on wl_surface - an interface could have several requests assigning different roles, cannot use wl_interface as the unique key; use an arbitary string instead - ensure in window-manager.c that create_shell_surface() -> create_common_surface() is never called with surface->configure set, to avoid compositor abort - use wl_resource_post_no_memory() where appropriate instead of hand-rolling it with wl_resource_post_error() Ideally we would not add weston_surface::role_name field, but use weston_surface::configure. At the moment this is not possible though, because at least shell.c uses several different roles with the same configure function. Drag'n'drop uses two configure functions for the same role. The configure hook is also reset in several places, which is not good for role tracking. This patch overlooks the wl_surface roles assigned in privileged extensions: screensaver, panel, background, lock, input panel. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
* shell: don't crash on create_common_surface() failurePekka Paalanen2014-10-011-0/+6
| | | | | | | | Noticed while reading code, that create_common_surface() may return NULL, and callers of its direct callers check for NULL, but the intermediate function in between would crash. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* shell: fix weston_output_mode_switch() usageDerek Foreman2014-09-221-3/+3
| | | | | | | | | | | | | Calling weston_output_mode_switch() with WESTON_MODE_SWITCH_RESTORE_NATIVE will result in the mode being set "back" to the passed in mode - so the passed mode should be the native mode. Additionally, weston_output_mode_switch() should be called when output->original_mode is non-NULL (which indicates we had a temporary mode set). The comparison to current_mode results in a lot of log chatter. Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* cosmetic: update comments that refer to weston_surface_update_transform()Derek Foreman2014-09-111-1/+1
| | | | | | | | | | weston_surface_update_transform() no longer exists, except in comments. Fix that. [Pekka Paalanen: don't lose the full comment in compositor-drm.c.] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>