Commit Graph

153 Commits

Author SHA1 Message Date
Kristian Høgsberg 9724b51750 More weston rename fixes 2012-01-03 14:35:49 -05:00
Kristian Høgsberg e7aaec301a x11: Bridge X11 CLIPBOARD selection to Wayland clients 2011-12-27 13:50:04 -05:00
Kristian Høgsberg e04ad57a01 window.c: Add touch event stubs
Prevent window.c clients from crashing on touch events.
2011-12-22 11:32:38 -05:00
Kristian Høgsberg 8a1d10d66c window.c: Rename input handlers to input_handle_*
They're event handlers for the input object, not the window object.
2011-12-22 11:32:34 -05:00
Pekka Paalanen 325bb60792 window: destroy surfaces on display_destroy()
Destroy the window decoration surfaces and pointer surfaces.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-22 11:27:51 +02:00
Pekka Paalanen e1207c708e window: destroy all inputs on display_destroy()
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-22 11:27:51 +02:00
Pekka Paalanen c20529846e window: destroy misc objects on display_destroy()
Windows are supposed to be destroyed by the application explicitly.

Deferred tasks are not supposed to be added after returning from
display_run().

Destroy remaining wl objects (except input related will be in a
following patch).

Close the epoll fd.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-22 11:27:51 +02:00
Pekka Paalanen 2c1426a72f window: destroy outputs on display_destroy()
This will also start calling the output destroy handlers, if an
application has set any.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-22 11:27:51 +02:00
Pekka Paalanen 5ec6585753 window: destroy window surfaces and title
Plugs leaks from struct window in window_destroy().

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-22 11:27:51 +02:00
Pekka Paalanen 51ce95a6eb window: remove unused struct members
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-22 11:27:50 +02:00
Pekka Paalanen fe6079ac09 window: add display_destroy()
Add a function to destroy the 'struct display', supposedly with all
contained resources, that are not explicitly created by the application.

The implementation at this time is incomplete. It does clean up the
following:
- xkb structure is freed (needs new libxkbcommon from git)
- EGL resources are freed
- wl_display is flushed and destroyed

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-22 11:27:50 +02:00
Pekka Paalanen 826d795448 window: add display_exit()
Add a function, that schedules the display_run() event loop to break
out.

When display_exit() is called, processing continues as usual, until
currently waiting events and deferred tasks have been processed, and
sent requests are flushed. Then, display_run() will return.

This enables toytoolkit apps to handle their exit instead of just being
killed or call exit().

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-22 11:27:50 +02:00
Kristian Høgsberg bbedd7e9d2 clients: Implement a toy-menu for testing the menu surface type 2011-12-19 15:40:10 -05:00
Pekka Paalanen 9015ead7d6 window: do proper Cairo device flushing
The Cairo documentation tells us to always call cairo_device_flush()
before using other rendering APIs on the cairo surface, especially where
the Cairo device shares state with us (that is, EGL and GL state in this
case).

Add a call to cairo_device_flush() into display_acquire_window_surface(),
which the toytoolkit offers for switching to native (GL) rendering.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-19 10:50:38 -05:00
Kristian Høgsberg cd9ac1da5f compositor: Remove server side cursors
We always expect the clients to set the cursor and attaching a NULL buffer
hides the cursor.  The cursor starts out hidden.
2011-12-15 09:15:08 -05:00
Pekka Paalanen 999c5b5dcb window: expose outputs to applications
Add output_configure_handler as a display property. This exposes only
configured outputs, that is the current mode info is already received,
to applications.

The handler is also called for mode changes on an existing output. This
simplifies the implementation in toytoolkit as we can defer the handler
calls from wl_output binding time to when we receive the current mode.
We do not need separate handlers for "new output" and "mode changed". A
plain "new output" handler would be problematic as the current mode is
not known yet.

Also add delete_handler hook for outputs, but that will never be called
for now, as the protocol lacks a way to signal output disconnections.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-14 11:17:46 +02:00
Pekka Paalanen 6b2dc9119e window: do not crash without wl_shell
Since it is the desktop-shell plugin in the compositor that offers both
wl_shell global interface and wl_shell_surface interface, those are not
available on the tablet-shell plugin.

The tablet-shell client uses the toytoolkit, so toytoolkit must work
somehow even without wl_shell.

Turn all operations in toytoolkit that would require wl_shell or
wl_shell_surface into no-ops.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-04 14:55:40 -05:00
Pekka Paalanen 068ae944db desktop-shell: update protocol and client to wl_shell_surface
Change desktop-shell protocol to use wl_shell_surface instead of
wl_surface.

Adapt the desktop-shell client and the shell plugin.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-04 14:54:34 -05:00
Pekka Paalanen 9d1613eb4a wl_shell_surface adaptation
Protocol changes in Wayland core introduced a new interface
wl_shell_surface, and moved all wl_shell surface methods into it. Adapt
the compositor and its Wayland backend, shell plugin, and all clients to
the new interface.

Depends on the Wayland core commit "protocol: introduce wl_shell_surface"

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-04 14:54:26 -05:00
Pekka Paalanen a03a93c6ea window: fix segfault in window_handle_key()
When a window destroyed, if any input had the window in keyboard
focus, the keyboard focus is reset to NULL. A new keyboard focus is set
only, if the user clicks something. If the user presses a key instead of
clicking, the key press event is sent to the client which has NULL
keyboard focus, triggering a segfault in window_handle_key().

Fix the segfault by ignoring the key event, if there is no target
window.

I triggered this segfault by clicking the unlock dialog away, and then
pressing a key.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-12-02 06:31:08 -05:00
Kristian Høgsberg 53ff2f6672 window.c: Cache outputs 2011-11-26 17:27:37 -05:00
Kristian Høgsberg 47fe08aad5 Implement the new dnd/selection protocol
The new protocol splits dnd/selection from wl_shell and allows us to move
the implementation out of shell.c.
2011-11-23 16:20:28 -05:00
Kristian Høgsberg c5241f5b73 Never include wayland-util.h directly
And fix a missing "" to <> conversion for wayland-client.h include.
2011-11-22 09:35:14 -05:00
Pekka Paalanen 50719bce2a Fix inconsistent #include style
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-22 09:27:03 -05:00
Kristian Høgsberg 980c49e6cd window: Remove unused variable 2011-11-18 15:24:23 -05:00
Pekka Paalanen 77cbc951cb window: clean up redraw and focuses on destroy
Currently, the way to destroy a window in a response to an event (e.g.
button click), is to put a task into the deferred list with
display_defer(). The task will then call window_destroy() from outside
event handling code.

As events are handled, it is possible that the deferred list contains
also the redraw task for this window. As the execution order of these
tasks is unknown (redrawing a freed window is a bug) and redrawing
something that goes away immediately is not useful, the redraw task must
be removed on window_destroy().

'struct input' contains pointers to windows currently in focus for that
input device. These pointers must also be cleared on window_destroy().
This fixes a use-after-free bug for the unlock dialog in desktop-shell
(future commit).

As an irrelevant minor cleanup, window::grab_device member is not used
anywhere, and is removed.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2011-11-15 16:43:24 -05:00
Rob Bradford 8bd35c7770 window: Avoid setting an invalid surface for the pointer
If we failed to load the pointer image to the surface then do not create a
buffer from a NULL surface and do not attach that to the device.
2011-10-25 12:20:51 +01:00
Rob Bradford 21223bf6d1 window: Report an error if we cannot load the pointer files 2011-10-25 12:19:36 +01:00
Kristian Høgsberg bcee9a4b25 desktop-shell: Add beginning of pop-up menu to panel 2011-10-12 00:36:16 -04:00
Benjamin Franzke 1a89f28c7d gears: Fail if compiled without cairo-egl 2011-10-07 10:06:01 +02:00
Benjamin Franzke 0c99163d9b window: Create a cairo device for each egl config 2011-10-07 10:06:01 +02:00
Benjamin Franzke 47eb8f4e91 window: Remove display_flush_cairo_device
Rather add a flush_surface utility that
flushed the cairo_device thats associated to a surface.
2011-10-07 10:05:57 +02:00
Kristian Høgsberg e4fb78de8f Handle compositors without wl_shell 2011-09-21 17:43:32 -04:00
Kristian Høgsberg e28d05b0ad window.c: Move window items to window.c 2011-09-20 21:43:54 -04:00
Kristian Høgsberg 3a69627f43 window: Stop using glib mainloop in toy toolkit 2011-09-19 17:28:55 -04:00
Kristian Høgsberg 1e164b9afd Move rounded_rect() to cairo-util.c 2011-09-19 17:26:44 -04:00
Kristian Høgsberg 547da5afc9 terminal: Make -f (fullscreen) option work again 2011-09-19 17:26:30 -04:00
Kristian Høgsberg f8ab46e149 window: Default to toplevel windows 2011-09-08 16:56:38 -04:00
Kristian Høgsberg 0c29eb292e clients: Add a simple desktop-shell app
This just provides the background surface and the top panel.
2011-09-06 18:02:34 -04:00
Kristian Høgsberg 900b226ac1 window: Add enter/leave handlers 2011-09-06 14:33:52 -04:00
Benjamin Franzke 4b87a13974 clients: Fix typos
And forgotten display_create conversion in view.c.
2011-09-01 10:36:53 +02:00
Benjamin Franzke 91eacca38b Remove egl display type setenv hack
No longer needed with mesa 7.12-devel egl display autodetection.
2011-08-31 16:25:18 -04:00
Kristian Høgsberg f389cacc20 Move away from visuals and just use EGLConfigs or shm format tokens 2011-08-31 16:21:38 -04:00
Kristian Høgsberg 9de79a92a6 window.c: Drop global handler argument
We can just register a global handler directly on the wl_display now.
2011-08-29 17:12:36 -04:00
Kristian Høgsberg a8d1fa762e clients: Bring clients up to date 2011-08-29 17:12:36 -04:00
Kristian Høgsberg 334182062f Use the new wl_callback interface 2011-08-29 17:12:36 -04:00
Benjamin Franzke 22d5481f91 window.c: Fix compile/run using cairo without egl 2011-07-15 17:56:04 +00:00
Benjamin Franzke 14f7ff91ad window: Set egl_window_resize late and once
Previously we resized in attach_surface and create_surface.
THe second resize overwrote dx or dy from the first.
2011-06-23 12:10:51 +02:00
Kristian Høgsberg 8f0ce05f52 compositor: Send out more detailed output events 2011-06-21 11:16:58 -04:00
Kristian Høgsberg 7a5c979f4c Move map requests to shell 2011-06-20 10:45:24 -04:00