summaryrefslogtreecommitdiff
path: root/clients/window.c
Commit message (Collapse)AuthorAgeFilesLines
* window: use roundtrip instead of dispatch after get_registryMarek Chalupa2014-12-121-1/+1
| | | | | | | | | | | | wl_display_dispatch() just dispatches events that are in default and display queues and if there are no events, then it will wait for them. But only dispatching the events doesn't guarantee that we got all the global announcements, we need to do sync too. Therefore use wl_display_roundtrip() instead of wl_display_dispatch(). Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* clients: support ivi-application.xml for clients/window.cNobuhiko Tanibata2014-12-041-10/+57
| | | | | Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* clients: Use xmalloc in a few more placesDerek Foreman2014-11-281-1/+1
| | | | | | | | Just changes some places where a malloc failure is unhandled to our xmalloc function that exit()s a little more gracefully. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
* window : compare version and call appropriate destructorkabeer khan2014-11-041-4/+10
| | | | | | | [Pekka Paalanen: removed trailing space, split long line.] Signed-off-by: kabeer khan <kabeer.khan@samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* clients: Maximize window when double touch on title barXiong Zhang2014-09-221-2/+24
| | | | Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
* window: Don't needlessly sync parent and geometryOndřej Majerech2014-09-151-0/+12
| | | | | | | | | | | | | | | When a toytoolkit client redraws, the toolkit syncs the parent and geometry. If a client redraws often (such as the terminal drawing a huge amount of output), this can spam the compositor with requests and may result in the client's eventual being killed. We don't need to send requests for changing the geometry or parent if these haven't changed. So remember the last geometry and parent, and update them only if needed. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=83297 Signed-off-by: Ondřej Majerech <majerech.o@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* Partially revert "xdg-shell: Add show_window_menu request"Pekka Paalanen2014-09-111-7/+49
| | | | | | | | | | | | This reverts the parts of commit 81ff075bf48c55cd07e37784e20c310fa52ed926 that touch window.c. This brings the toytoolkit window context menus back, until someone implements the xdg-shell equivalent in the compositor. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=82972 Acked-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* clients: Maximize window when double click on title barXiong Zhang2014-09-041-1/+25
| | | | | Signed-off-by: Xiong Zhang <panda0626@gmail.com> Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* window: unbind egl surface and context on surface releaseArnaud Vrac2014-08-271-2/+2
| | | | | | Binding null read and write surfaces to an egl context is not standard Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* xdg-shell: bump experimental protocol versionPekka Paalanen2014-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | The experimental versioning has not been updated when it was supposed to. Let's try to be better at it now, as xdg-shell is close to have its first stable version. Bump the version now to bring the world into the same exact version. There may be some protocol changes still coming, but we try to land them before 1.6 gets out. Those changes will bump the experimental version again as needed. When 1.6.0 is released, the experimental version will no longer be bumped, and no incompatible protocol changes will be made. Xdg-shell.xml file will move to Wayland in 1.7.0, drop the experimental versioning, and become stable. Cc: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* Replace deprecated xkbcommon symbols with current namesRan Benita2014-08-201-12/+12
| | | | | | | | | | | These symbols (xkb_map_* and others) were replaced in xkbcommon with more consistent names. See the header xkbcommon/xkbcommon-compat.h for how the old names map to the new. The new names have been available since the first stable xkbcommon release (0.2.0). Signed-off-by: Ran Benita <ran234@gmail.com>
* clients: use repeat_info event detailsJonny Lamb2014-08-151-5/+44
| | | | | The weston-info client prints out the values, and the values are respected in toytoolkit when actually repeating keys..
* window: Don't use the frame's geometry when fullscreenJasper St. Pierre2014-08-051-2/+2
| | | | | When fullscreen, we don't actually update the frame's geometry, so we can't query it for there.
* shell: Replace set_margin with set_window_geometryJasper St. Pierre2014-07-171-13/+22
| | | | | | | | | | | | | | | | | | | 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.
* Interpret the size in the configure event as window geometryJasper St. Pierre2014-07-171-1/+17
| | | | | The size of the configure event has always been specified as in window geometry coordinates, but it was never implemented this way.
* xdg-shell: Add show_window_menu requestJasper St. Pierre2014-05-231-49/+7
|
* clients: Allow creating a "detached" menuJasper St. Pierre2014-05-231-14/+50
| | | | This will be used by the xdg_surface.show_menu_window implementation.
* clients: Remove the window / user parameters from the menu functionJasper St. Pierre2014-05-181-6/+5
| | | | We want the ability to create a detached menu.
* window: Send ack_configure immediately from configure handlerKristian Høgsberg2014-05-121-9/+1
| | | | | | | Once we've updated the window state and scheduled a resize, we know that the next frame we send to the compositor will match the configured state. This means we can just ack the configure immediately and not jump through hoops to try to do it from the redraw stage.
* window: Move the resize after interpreting the statesJasper St. Pierre2014-05-121-8/+8
| | | | | | As the protocol says, the states determine how the width and height arguments should be interpreted, so it makes logical sense to do the interpretation after.
* window: Set frame flags immediately when we handle the new states in configureJasper St. Pierre2014-05-121-12/+14
|
* xdg-shell: Turn "activated" into a stateJasper St. Pierre2014-05-121-16/+4
| | | | | This drops two events, and makes new window decorations race-free with an attach in-flight.
* terminal: Only add the new size to the title when we're resizingJasper St. Pierre2014-05-121-0/+17
| | | | | | | Add a new state_changed_handler callback to the window to know when the window has changed state; the terminal will use this to know when the window started and ended its resize operation, and modify the terminal's titlebar accordingly.
* xdg-shell: Turn the resizing heuristics into an explicit stateJasper St. Pierre2014-05-121-7/+4
| | | | | | | | | | | | | | | | Currently, there's a race condition. When resizing from the left, and a client attaches a buffer after the resize ends, you suddenly see the buffer jump to the right, because the resize ended while multiple attaches were in-flight. Making resize a state can fix this, as the server can now know exactly when the resize ended, and whether a commit was before or after that place. We don't implement the correct tracking in this commit; that's left as an exercise to the reader. Additionally, clients like terminals might want to display resize popups to display the number of cells when in a resize. They can use the hint here to figure out whether they are resizing.
* xdg-shell: Rework the state systemJasper St. Pierre2014-05-121-33/+42
| | | | | | The states system, so far, has been a complicated mix of weird APIs that solved a real race condition, but have been particularly ugly for both compositors and clients to implement.
* xdg-shell: Rename set_transient_for to set_parentJasper St. Pierre2014-05-131-12/+12
| | | | | | | | | It's a confusing name that comes from the ICCCM. The ICCCM is best forgotten about. With the addition of the potential new "transient" role meaning a parent-relative toplevel like a long-lived popup, used for e.g. tooltips, the set_transient_for name will become even more confusing.
* window: Ignore input events from subsurfacesAnder Conselvan de Oliveira2014-05-121-5/+16
| | | | | | | | | | | | | | | | | | | | | | Toytoolkit was not designed to handle input from subsurfaces and instead it expects subsurfaces to have an empty input region. That way input events for subsurfaces are generated on the main surface and there is no need to convert coordinates before reporting the event to the user. However it is possible that a subsurface has a non-empty input region, but in that case those events aren't properly processed. The function window_find_widget() assumes the coordinates are in the main surface coordinate space, and ends up chosing the wrong widget. This patch changes the input code to completely ignore input events from subsurfaces. This option was chosen instead of ensuring that the input region on those surfaces is always empty since there's no enforcement that a subsurface should completely overlap with the main surface. If an event happens in the area of the surface that doesn't overlap, the event could cause a completely unrelated surface to be picked. https://bugs.freedesktop.org/show_bug.cgi?id=78207
* window: Add a simple getenv to force SHM renderingJasper St. Pierre2014-04-301-2/+2
|
* window: Clean up buffer type choosingJasper St. Pierre2014-04-301-8/+12
| | | | | Extracting it to a function makes this cleaner and more understandable.
* window.c: Dismiss menu on touch up eventsKristian Høgsberg2014-04-291-0/+15
|
* window.c: Also grab touch events when grabbing inputKristian Høgsberg2014-04-291-3/+6
|
* window.c: Prevent key event delivery while a grab is activeKristian Høgsberg2014-04-291-0/+8
| | | | | | Ideally, we'll update the key event handling to deliver events to widgets, but in the meantime, just blocking key event delivery while a grab is active goes a long way.
* window.c: Update pointer focus when taking a grabKristian Høgsberg2014-04-291-0/+2
|
* clients/window: Don't remove the touch listener on a frame eventNeil Roberts2014-04-251-3/+0
| | | | | | | | | It looks like the handler for frame events from the wl_touch interface for widgets may have been erroneously copied from the cancel handler so that it removes all handlers as they are processed. I don't think this makes much sense for the frame event. This was stopping the panel icons from being pushable with touch events when using libinput since commit 1679f232e541489e. All that commit does it make it start sending the frame events.
* window.c: Create xdg_surface up frontKristian Høgsberg2014-04-071-10/+15
| | | | | | Fixes initial fullscreen for calibrator. https://bugs.freedesktop.org/show_bug.cgi?id=76970
* toytoolkit: match parent surface type when adding a subsurfaceManuel Bachmann2014-04-061-0/+7
| | | | | | | | | | | | When adding a subsurface (to display a tooltip) in toytoolkit, we now get the parent window surface type (SHM or EGL) and define the new surface type as the same. This fixes crashes with tooltips in cases like having Cairo-EGL available but running the X11 compositor. Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* toytoolkit: Don't crash if wl_data_device_manager is not presentJason Ekstrand2014-04-021-8/+16
| | | | | | | This is primaraly to get weston-fullscreen to run on compositors that lack copy-paste support. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* toytoolkit: Expose output make and modelJason Ekstrand2014-04-021-0/+22
| | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* toytoolkit: Only require xdg_shell if the window is not customJason Ekstrand2014-04-021-1/+1
| | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* Check return value of wl_cursor functionsHardening2014-04-011-0/+4
| | | | | | This patch adds checks for themes and cursors returned by wl_cursor functions. Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
* clients: Remove unused client-side resize tracking codeJasper St. Pierre2014-03-241-17/+4
|
* xdg-shell: Bump unstable version to 3Kristian Høgsberg2014-02-191-1/+1
|
* xdg-shell: Replace the set_* atrocity with a new approachJasper St. Pierre2014-02-191-71/+30
| | | | | | Rather than require that the client implement two methods for every state, simply have one global request, change_state, and one global event, request_change_state.
* xdg-shell: Rename focused_set / focused_unset to activated / deactivatedJasper St. Pierre2014-02-181-4/+4
| | | | To try and make the distinction between this event and keyboard focus.
* clients: Add support for the minimize buttonJasper St. Pierre2014-02-181-2/+13
|
* Reorder the xdg_shell implementations to fit the spec'd orderJasper St. Pierre2014-02-181-12/+12
|
* window: Remove window_location enumJasper St. Pierre2014-02-181-18/+2
| | | | It's unused except for one easily-replaceable place.
* toytoolkit: avoid unnecessary redraws when focus changesEmilio Pozuelo Monfort2014-02-181-2/+0
| | | | | | | | | | Clients that need to be redrawn when the focus changes do that by listening to focus_changed and scheduling a redraw. This was causing unnecessary redraws in the clients, as could be easily seen by changing focus on weston-flower. Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
* client: Fix shell unstable version checkKristian Høgsberg2014-02-111-1/+7
| | | | | | | | Use a static assert to catch mismatch between implementation and interface version. Fix window.c to not use XDG_SHELL_VERSION_CURRENT, which will fail to catch version mismatches. The implementation version must updated manually when the implementation is updated to use the new interface.
* xdg-shell: Move "ping" and "pong" to xdg_shell, not xdg_surfaceKristian Høgsberg2014-02-111-14/+11
| | | | | | | Responsivenes is a per-client thing so we move the ping/pong functionality to xdg_shell. Having this per-window was carries over from the EWMH protocol, where the WM has no other way to do this. In wayland, the compositor can directly ping the client that owns the surface.