Commit Graph

530 Commits

Author SHA1 Message Date
Scott Moreau
befa65318a compositor: Update grab variable in notify_key() after binding handler.
We need to update the temp grab pointer after weston_compositor_run_key_binding()
before calling the key handler because it may have installed a new grab.
2012-06-11 18:24:16 -04:00
Kristian Høgsberg
23cf9eb04f Refine the build id string
We use git describe to get the SHA1 so that we append -dirty for dirty
worktrees and include the HEAD commit subject and date.
2012-06-11 12:15:46 -04:00
Pekka Paalanen
4e4167d3a0 compositor: log more EGL and GL info
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-11 09:48:34 -04:00
Pekka Paalanen
1b3c1ea880 compositor: log module loading
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-11 09:48:02 -04:00
Pekka Paalanen
7f4d1a3534 compositor: move uname log earlier
Basic information that does not depend on any modules.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-11 09:47:55 -04:00
Pekka Paalanen
29e09a92cb ignore git-version.h
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-11 09:47:43 -04:00
Pekka Paalanen
bce4c2b1ca compositor: prettify program info in log
No need to print current date-time anymore, since log.c does the date
automatically.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-11 09:47:26 -04:00
Martin Minarik
f5c7576581 compositor-android.c: Add missing include log.h
Due to missing include, the messages from
compositor-android are not processed.

Thanks to collegue for reminding of this issue.
2012-06-11 09:43:02 -04:00
Martin Minarik
bae4351931 Log: Remove date from timestamp, log it only once.
This patch may be useful, the timestamp with date seems too long.
2012-06-11 09:42:57 -04:00
Martin Minarik
f12c2879c6 compositor: Print uname information to log
It is useful to have relevant information about the host system.

Example:
[..] OS: Linux, 3.0.0-13-generic, #22-Ubuntu SMP Wed Nov 2 13:25:36 UTC 2011, i686
2012-06-11 09:42:08 -04:00
Rafal Mielniczuk
6e0a7d82b7 compositor: change position of weston_log_file_open call
In case XDG_RUNTIME_DIR was not set, weston_log
will crash the compositor instead of spitting
error msg, as weston log was not yet opened
2012-06-11 09:37:02 -04:00
Scott Moreau
d64cf21246 Add frame_counter to weston_animation. 2012-06-11 09:33:06 -04:00
Scott Moreau
9d1b1125fd Move animation_list to weston_output. 2012-06-11 09:32:47 -04:00
Kristian Høgsberg
fc9c5e04fd log: Add some diagnostics to the log
Just a few useful things to get this started: egl vendor and extensions,
gles2 extensions, drm and kms info and just a bit of x11 backend info.
2012-06-08 16:45:33 -04:00
Kristian Høgsberg
a411c8b66c log: Print sha1 of HEAD and the date and time as the first thing in the log 2012-06-08 16:16:52 -04:00
Kristian Høgsberg
a7496e1c61 Add a makefile hook to generate git-version.h 2012-06-08 16:16:16 -04:00
Martin Minarik
eb587650d2 log: Fixes
Drop the timestamp caching because it doesn't seem useful.
Use gettimeofday() to obtain system time.
Add null checks to both contstructor and destructor.
Drop the flushing and set line buffering instead.
Remove weston_log_print(), it only wraps vfprintf anyways.
2012-06-08 15:14:37 -04:00
Martin Minarik
6d11836721 Replace fprintf() by weston_log() 2012-06-08 13:11:36 -04:00
Martin Minarik
19e6f2693d Add logging functionality
This is logging functionality for weston compositor.

It handles:
messages coming from libwayland-server from wl_log()
messages from weston itself, from weston_log()

Introduce --log option, to specify log file path on the command line.
When the path is incorrect, or on weston_log_file_destroy(), fall
back to stderr.
2012-06-08 13:11:29 -04:00
Pekka Paalanen
3ab7269a9b compositor: return failure even if SEGV handler works v2
Weston has a SIGSEGV handler that attempts to shut everything down
cleanly. If it actually succeeds in that, the process exit status will
indicate success, when the process just segfaulted.

Fix that by setting the return value to failure in the SEGV handler.

v2: use a local instead of a global variable

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-08 12:52:18 -04:00
Kristian Høgsberg
b2af93ef8c compositor: Drop weston_surface_to_global()
Just always call weston_surface_to_global_float() instead.
2012-06-07 20:10:23 -04:00
Kristian Høgsberg
9a050afc06 compositor: Emit destroy signal when we manually destroy a weston_surface 2012-06-07 18:17:42 -04:00
Kristian Høgsberg
633b14505c shell: Emit destroy signal for when we manually destroy shell surface 2012-06-07 18:08:47 -04:00
Kristian Høgsberg
47b5dca409 shell: Don't remove grab listener if surface was destroyed 2012-06-07 18:08:04 -04:00
Scott Moreau
3f79d661a1 zoom: Convert wl_fixed_t directly into floats, to avoid truncation.
This fixes center point inaccuracy for rotated surfaces. Thanks to
Pekka Paalanen for spotting it.
2012-06-07 17:15:32 -04:00
Pekka Paalanen
bdc7cd06d1 compositor: fix a crash on missing keyboard device
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-07 16:44:13 -04:00
Pekka Paalanen
43e1ba8073 shell: fix crash when no pointer device
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-07 16:43:56 -04:00
Pekka Paalanen
36f155f80f compositor-x11: add an option to ignore input
For testing the compositor without any input devices. Exposes cases
where e.g. keyboard or pointer are NULL-dereferenced.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-07 16:43:40 -04:00
Pekka Paalanen
4e1f2ff1c6 shell: fix a crash during 'make check'
$ abs_builddir=$PWD/tests gdb -args ./src/weston --module=$PWD/tests/.libs/event-test.so

(gdb) run
Starting program: /home/pq/git/wayland-demos/src/weston --module=/home/pq/git/wayland-demos/tests/.libs/event-test.so
[Thread debugging using libthread_db enabled]
Mesa: Initializing x86-64 optimizations
launching /home/pq/git/wayland-demos/tests/test-client
created output global 0x608f50
test-client: got create-surface
got surface 5 from client
got surface id 5

Program received signal SIGSEGV, Segmentation fault.
Mesa: Initializing x86-64 optimizations
0x00007fffeff72c7c in handle_pointer_focus (listener=0x74f5c0, data=0x6faa40) at shell.c:492
492		if (shsurf->unresponsive) {
(gdb) bt
 #0  0x00007fffeff72c7c in handle_pointer_focus (listener=0x74f5c0, data=0x6faa40) at shell.c:492
 #1  0x00007ffff5ed8b87 in wl_signal_emit (data=0x6faa40, signal=0x6faa88) at wayland-server.h:166
 #2  wl_pointer_set_focus (pointer=0x6faa40, surface=<optimized out>, sx=12800, sy=12800) at wayland-server.c:752
 #3  0x0000000000407d92 in weston_device_repick (seat=0x6fa930) at compositor.c:633
 #4  0x0000000000407e49 in weston_compositor_repick (compositor=0x61c510) at compositor.c:656
 #5  0x00000000004092e1 in weston_output_repaint (output=0x7b85b0, msecs=-1046834186) at compositor.c:1059
 #6  0x00000000004094b4 in weston_output_finish_frame (output=0x7b85b0, msecs=-1046834186) at compositor.c:1092
 #7  0x00007ffff211e3c1 in finish_frame_handler (data=0x7b85b0) at compositor-x11.c:284
 #8  0x00007ffff5eda603 in wl_event_source_timer_dispatch (source=0x79ee50, ep=<optimized out>) at event-loop.c:173
 #9  0x00007ffff5edaca0 in wl_event_loop_dispatch (loop=0x61b940, timeout=<optimized out>) at event-loop.c:410
 #10 0x00007ffff5ed8dbd in wl_display_run (display=0x61b8f0) at wayland-server.c:1025
 #11 0x000000000040ecb1 in main (argc=1, argv=0x7fffffffdd98) at compositor.c:3225
(gdb) print shsurf
$1 = (struct shell_surface *) 0x0

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-06 13:27:56 -04:00
Pekka Paalanen
78a0b57e57 compositor: print a clear message when XDG_RUNTIME_DIR is not set
Without this patch, Weston would not start with the message:
creating a keymap file for 44012 bytes failed: No such file or directory

If you do not know, that we use XDG_RUNTIME_DIR for that, the message is
very confusing. Therefore implement a clear error message right at the
start if XDG_RUNTIME_DIR is not set.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-06 13:27:04 -04:00
Pekka Paalanen
1da1b8f3f1 Rewrite shm buffer file allocation v2
We had duplicated code in many places, using hardcoded paths for
temporary files into more than one path. Some cases did not bother with
O_CLOEXEC, and all hardcoded paths that might not exist.

Add an OS helper function for creating a unique anonymous file with
close-on-exec semantics. The helper uses $XDG_RUNTIME_DIR as the
directory for a file.

This patch unifies the buffer file creation in both Weston and the
clients.

As simple clients are better not linking to libshared, as it would
require e.g. Cairo, they pull the OS compatibility code directly.

Android does not have mkostemp(), so a configure test is added for it,
and a fallback used if it is not available.

Changes in v2:
	remove all the alternate possible directory definitions and use
	XDG_RUNTIME_DIR only, and fail is it is not set.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-06 13:26:30 -04:00
Bill Spitzak
b715ceca33 compositor-x11: Return number of events processed
The event handler is supposed to return 0 if no events were handled and
a positive number if events were handled.  event always end up being NULL
however, so we always return 0.
2012-06-05 17:08:23 -04:00
Tiago Vignatti
771241e88f xwm: use override_redirect for determining or not top-level windows
"top-level window is a window whose override-redirect attribute is False",
ICCCM 4.1.1

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-06-05 11:49:18 -04:00
Tiago Vignatti
71574542b3 xwayland: fix typo on configure libs
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-06-05 11:46:51 -04:00
Kristian Høgsberg
be375b362b xwm: Only destroy window frame in unmap_notify if we have one
Based on a patch from Tiago Vignatti <tiago.vignatti@intel.com>.
2012-06-05 11:46:08 -04:00
Kristian Høgsberg
9892a62b45 compositor: Remove left-over 'bright' shader uniform 2012-06-05 10:49:22 -04:00
Kristian Høgsberg
361039820b compositor: Drop brightness and saturation features in the shader 2012-06-05 10:15:56 -04:00
Kristian Høgsberg
d56bd908bf shell: Use a busy cursor animation for unresponsive surfaces 2012-06-05 09:58:51 -04:00
Kristian Høgsberg
4e99ac4f20 compositor: Set pointer->current before calling focus handler
The grab interface handlers all expect pointer->current to identify
the surface under the pointer regardless of grabs etc.  Thus, we need
to set it before calling the focus handler.
2012-06-04 16:12:38 -04:00
Scott Moreau
6597506ac3 Remove Intel from text-cursor-position.c copyright header. 2012-06-04 11:08:26 -04:00
Scott Moreau
ae71220fc9 Convert text cursor position protocol to use fixed types. 2012-06-04 11:07:50 -04:00
Daniel Stone
bbf63bf92c Fix inverted LEDs
Turns out it's probably better to post the new state rather than the
old.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-04 11:03:02 -04:00
Daniel Stone
e9e92d2ad7 Fix sessions with no active input devices
Fix a few unconditional dereferences of seat->keyboard and seat->pointer
in paths that could be hit outside of input event processing.

Reported-by: Pekka Paalanen <ppaalanen@gmail.com>
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-04 11:02:53 -04:00
Daniel Stone
a497d57619 compositor-wayland: Delay seat creation
We'll get a rash of seats added when we run our first wl_display_iterate
across the parent display, but won't actually be ready to create them.
Create a new global listener on our parent display for wl_seats only,
and run that from wayland_input_create.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-04 11:01:39 -04:00
Kristian Høgsberg
670b5d343d xwm: Take WM_S0 manager selection 2012-06-04 11:00:40 -04:00
Kristian Høgsberg
cba022af3d xwm: Claim the CLIPBOARD_MANAGER selection 2012-06-04 10:11:45 -04:00
Kristian Høgsberg
a7ceafff9c compositor: Add a clipboard manager
We use the selection signal to get a callback when somebody sets a
selection (including the X server proxy) and then copy the contents
of the first mime type.  If the selection is cleared (when the client
dies), we set a new selection with that contents.
2012-06-03 22:54:36 -04:00
Kristian Høgsberg
e220327223 xwm: Initialize X selection on X server startup
This way an already existing wayland selection will be available on
launch.
2012-06-03 17:59:04 -04:00
Kristian Høgsberg
4dec011807 xwm: Move selection proxy setup to selection.c 2012-06-03 17:59:04 -04:00
Kristian Høgsberg
c65d56a280 xwm: Follow wl_data_source changes
Creating the wl_data_offer is now entirely inside libwayland-server.
2012-06-03 17:58:45 -04:00