Putting panel_add_clock in launcher_section_done handler
will cause clock to be created multiple times with every launcher.
Fix is to move the call to panel_create function.
In clock_func() it is necessary to read the timer fd, or
it will stay readable, and the event loop will call the function again.
That causes an endless loop.
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.
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.
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>
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>
$ 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>
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>
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>
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.
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.
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>
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>
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.