summaryrefslogtreecommitdiff
path: root/xwayland
Commit message (Collapse)AuthorAgeFilesLines
* xwm: support maximizing xwayland windowsGiulio Camuffo2015-02-022-13/+82
| | | | | | | | | | | | 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>
* xwm: fix use after freeGiulio Camuffo2015-01-291-0/+7
| | | | | | | | | Calling wl_event_source_remove() will free the event source later, so reset the pointer to avoid calling it two times on the same pointer. Fix a compositor crash when copying some text from weston terminal, pasting it in the same terminal and hitting ctrl-u, while a X client is running. Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* xwm: set the _NET_WM_DESKTOP property of the windowsGiulio Camuffo2015-01-272-0/+31
| | | | | | | | | | | | | Some X clients use the _NET_WM_DESKTOP property to tell if the window is mapped or not. If set, it should say the virtual desktop the window is currently in, if unset it means the window is unmapped. The xwm currently has no way to know how many virtual desktops the shell plugin has, or if it even implements the metaphor. For now just set the property to 0, meaning the first desktop, if the window is mapped, and delete the property when unmapped. Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* xwm: don't set inactive surfaces as top levelGiulio Camuffo2015-01-261-2/+24
| | | | | | | | | | Some X clients create popup or tooltips windows as top level, without setting them as override redirect or as transient. Since we don't want to take the focus away from a surface when one of its popup is opened, check the _NET_WM_WINDOW_TYPE of the X surfaces being mapped and set them as inactive if it is one of some types. Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* xwm: fix a crash in handle_stateAndrew Engelbrecht2014-12-111-1/+3
| | | | | | | | | | | | | To produce the bug, build and run: (you don't need the game data to test) https://github.com/clintbellanger/flare-engine/ $ mv ~/.config/flare ~/.config/flare.bak $ ./flare # click 'configure', set full screen mode then click 'ok' # weston will crash and dump core. [Pekka: edited the commit message] Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* xwayland: fix fullscreeningMarek Chalupa2014-11-211-1/+1
| | | | | | | | | | | | 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>
* toytoolkit: rename tile_mask to render_shadowMarek Chalupa2014-11-191-3/+1
| | | | | | | | | This function is used and clearly designed only for drawing the shadows. Rename it so that it has name after what it does and also move some common code into the function. Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* xwm: find a seat for all the surface's viewsGiulio Camuffo2014-11-181-3/+4
| | | | | This allows to move or resize a xwayland client by acting on all its views.
* compositor: send error for surface role resetsPekka Paalanen2014-10-081-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* xwm: Do not activate override redirect windowsBoyan Ding2014-09-041-0/+3
| | | | | | | | | | We shouldn't do WM-y things on an O-R window, including setting input focus to it. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=81273 Signed-off-by: Boyan Ding <stu_dby@126.com> Tested-by: Ryo Munakata <ryomnktml@gmail.com> Acked-by: Christopher Michael <cp.michael@samsung.com>
* xwm: Check whether the seat is NULL when needed in weston_wm_handle_buttonBoyan Ding2014-09-031-2/+4
| | | | | | | | | | | | | | | XCB and wayland input event handling exists together in xwm, which can cause problems. weston_wm_handle_button is called via XCB events, while it calls weston_wm_pick_seat_for_window, which uses info from compositor (pure wayland). It is also true in setting and removing flags of frames. Races can happen in between, when resize of moving flag of the frame is still set while the button has been released, the picked seat will be NULL in weston_wm_handle_button, causing crash. We can safely ignore moving or resizing if this happens. The same applies to c06a180d. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=82827 Signed-off-by: Boyan Ding <stu_dby@126.com> Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* wm: Don't subtract the margins from the configured sizeJasper St. Pierre2014-08-271-7/+4
| | | | | | | | | When we moved the configure event size to being based on the window geometry, we changed the coordinates of the configure request to being frame geometry based. Frame geometry includes titlebar and border, but not shadow margins. Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* xwayland: Clean up the WM properly if X server crashesDima Ryazanov2014-08-271-2/+4
| | | | | | | | | The X cleanup code uses wxs->wm to check if the WM has been created - but that variable was never initialized. So if X crashes, the WM doesn't get destroyed, causing a crash when it tries to repaint a window. Signed-off-by: Dima Ryazanov <dima@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* xwm: check whether the picked seat can be NULLBoyan Ding2014-08-191-2/+2
| | | | | | | | | | The seat picked in weston_wm_window_handle_moveresize can sometimes be NULL when it is (somehow) triggered with all buttons released. This patch checks whether the seat is NULL to avoid NULL dereference. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=80837 Signed-off-by: Boyan Ding <stu_dby@126.com>
* xwayland: Better handle a race with XJason Ekstrand2014-07-241-0/+6
| | | | | | | If X windows are created and destroyed very fast sometimes the WM window object gets created and destroyed before we get around to handling client messages. Failing to check that the window is still valid can result in a segfault.
* xwayland/window-manager: Rename a variable for clerityJason Ekstrand2014-07-241-3/+3
|
* xwayland: set surface_id to 0 when client resource is foundTyler Veness2014-07-241-5/+8
| | | | | | | | | | | | | | | | | | | | | | When Xwayland requests that a wl_surface be created and the X event is handled before the wayland requests, a surface ID is stored to window->surface_id and the window is added to the unpaired window list. When weston_wm_create_surface is called, the window is removed from the list and window->surface_id is set to zero. If window->surface_id is not zero when weston_wm_window_destroy is called, the window is assumed to be in the unpaired window list and wl_list_remove is called. If weston_wm_window_handle_surface_id is called and the surface has already been created, the window is not added to the unpaired window list, but window->surface_id isn't set to zero. When the window is destroyed, removing the window from the list is attempted anyway and a crash occurs. This patch stores the surface ID in a temporary variable and only assigns it to window->surface_id when the window is added to the unpaired window list. Otherwise window->surface_id is set to zero to maintain its use as a flag variable. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=80273 Signed-off-by: Tyler Veness <calcmogul@gmail.com>
* shell: Replace set_margin with set_window_geometryJasper St. Pierre2014-07-171-6/+3
| | | | | | | | | | | | | | | | | | | Currently, there is a fun flicker when toggling maximization or fullscreen on a window in mutter or more sophisicated compositors and WMs. What happens is that the client want so go maximized, so we calculate the size that we want the window to resize to (640x480), and then add on its margins to find the buffer size (+10 = 660x500), and then send out a configure event for that size. The client renders to that size, realizes that it's maximized, and then says "oh hey, my margins are actually 0 now!", and so the compositor has to send out another configure event. In order to fix this, make the the configure request correspond to the window geometry we'd like the window to be at. At the same time, replace set_margin with set_window_geometry, where we specify a rect rather than a border around the window.
* Better error message when exec'ing Xwayland failsArnout Engelen2014-06-251-1/+5
|
* compositor: Remove the edges parameter from send_configureJasper St. Pierre2014-04-301-2/+1
| | | | | | | | | send_configure was originally modelled after wl_shell_surface::send_configure, which takes these arguments. However, the X WM and xdg_surface::configure variants don't use these arguments. We already store the resize edges for a surface while it's being resized, so just use the saved state in the wl_shell_surface variant.
* xwayland: Handle race between multi-pointer motion and clicksKristian Høgsberg2014-04-301-0/+7
| | | | | | | Make sure we're looking at the right location. The frame could have received a motion event from a pointer from a different wl_seat, but under X it looks like our core pointer moved. Move the frame pointer to the button press location before deciding what to do.
* xwayland: Set decoration margin for xwayland windowsKristian Høgsberg2014-04-301-1/+8
|
* xwayland: Be smarter about picking seats for move/resizeKristian Høgsberg2014-04-301-2/+24
| | | | | | | | | | | | If we're going to move or resize an xwayland surface, we used to just pick the first seat in the list for doing the move/resize. Ideally we can map from the XInput device doing the click to the corresponding weston_seat, but that requires using xcb xinput, which isn't well supported. Instead, lets use a simple heuristic that just picks the pointer that most recently delivered a button event to the window in question. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73807
* xwayland: Check zalloc return for out of memory situationBryce W. Harrington2014-04-251-0/+2
| | | | Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
* xwayland/launcher: Use %m instead of manual strerror(errno)Jasper St. Pierre2014-04-101-4/+2
|
* xwayland: Clean up unpaired surfacesKristian Høgsberg2014-04-071-0/+5
|
* Don't include xserver-server-protocol.hMariusz Ceier2014-04-073-3/+0
| | | | | | | It was removed in 757d8aff2757387bcd594e2ee2a27055b366eac3, along with xserver protocol. Signed-off-by: Mariusz Ceier <mceier+wayland@gmail.com>
* xwayland: Use new Xwayland DDXKristian Høgsberg2014-04-063-125/+174
|
* Makefile.am: Fix protocol source files usageQuentin Glidic2014-02-011-2/+0
| | | | Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
* xwayland: Fix typo in open flags for Xorg log fileKristian Høgsberg2014-02-011-1/+1
|
* build: Move xwayland/Makefile.am into toplevel Makefile.amKristian Høgsberg2014-02-011-42/+0
|
* Fix XWayland crashes when opening popupsAxel Davy2014-01-171-1/+1
| | | | Signed-off-by: Axel Davy <axel.davy@ens.fr>
* Fix XWayland transient window location.Axel Davy2014-01-131-2/+2
| | | | | | Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73517 Signed-off-by: Axel Davy <axel.davy@ens.fr>
* xwm: Handle WM_TRANSIENT_FORKristian Høgsberg2014-01-021-4/+10
| | | | | | | | Set up X windows that are transient for another window as transient surfaces in shell.c. This keeps the transient windows on top of their parent as windows are raised, lowered for fullscreened. https://bugs.freedesktop.org/show_bug.cgi?id=69443
* Update .gitignoreJasper St. Pierre2013-12-091-0/+2
|
* Move xwayland up one directory levelKristian Høgsberg2013-12-048-0/+4212