Commit Graph

3018 Commits

Author SHA1 Message Date
Jan Arne Petersen
8ccb7cc258 editor: Do not commit/preedit after invalid delete
Ignore the whole commit-string or preedit_string transaction when the
delete_surrounding event was invalid.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:55 -04:00
Jan Arne Petersen
895a128ce1 editor: Improve checks on delete add asserts
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:52 -04:00
Jan Arne Petersen
9eaa8e51ca editor: Properly adjust cursor on delete
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:48 -04:00
Jan Arne Petersen
a96953dffa editor: Support deleting text in preedit_string
Delete text marked with wl_text_input::delete_surrounding_text on
preedit_string event. When text is explicitly marked with
delete_surrounding_text do not delete selected text.

Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:46 -04:00
Jan Arne Petersen
1c45b4a4a9 editor: Fix text selection
Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
2013-06-04 00:34:42 -04:00
Armin K
49c36c6804 Don't fail if colord or libunwind are not present
This patch adds auto detection for presence of
the colord and libunwind packages.
2013-06-04 00:31:23 -04:00
Eduardo Lima (Etrunko)
4b2c236845 weston.pc: Added libexecdir and pkglibexecdir variables
These can be used by external clients to check the installation path

Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
2013-06-04 00:14:04 -04:00
Rob Bradford
f9e9d0d434 udev-seat: Fail input setup only if no devices are found
Rather than failing if we cannot open any single device fail the input
setup if there are no input devices added.

https://bugs.freedesktop.org/show_bug.cgi?id=64506
2013-06-04 00:13:20 -04:00
Hardening
b60e46f6ba Handle mouse wheel
The RDP compositor was ignoring mouse wheel events, this patch adds
support for it.
2013-06-04 00:10:19 -04:00
U. Artie Eoff
3b64d6236c use _exit instead of exit if client fails to exec
exit() calls atexit() handlers and C++ destructors (e.g. a C++
weston module) which could destroy state that the main process
depends on (e.g. ioctl's, tmpfiles, sockets, etc...).  If an exec
fails, call _exit() instead of exit().

v2: prefer _exit over _Exit

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
2013-06-04 00:07:10 -04:00
Alexander Larsson
b846a8d45e screenshooter: Scale damage by output scale in screen recorder
The damage region is in compositor coords, we need to scale it by
the output scale when using the damage to read output buffer data.
2013-05-29 10:22:15 -04:00
Alexander Larsson
97af792718 pixman-renderer: Fix read_pixels for screen recorder
The old code had an off-by-one error on the y coordinate
where it says height - (cur_y - y). And it does the vflipping of
the *destination* buffer, whereas what is really needed is to
vflip the whole source buffer. This only affects when you read
out part of the image, such as when using the screen recoder.

Also, instead of doing the flipping manually we just let pixman
handle it.
2013-05-29 10:22:01 -04:00
Alexander Larsson
5576546e3d screenshoter: Make recorder handle PIXMAN_x8r8g8b8
This is what the pixman renderer reports for the read format.
2013-05-29 10:21:58 -04:00
Alexander Larsson
690f718834 shell: Position DRIVER fullscreen surfaces at origin
When a window is fullscreened with DRIVER method and we succeeded
in changing mode we need to actually move the surface to the
origin of the output, or it won't be used for scanout.
2013-05-29 10:18:15 -04:00
Alexander Larsson
d622ed3fbf shell: Center window in fullscreen if needed
If modeset fails With DRIVER method, and always with FILL method
we want to center the window.
2013-05-28 17:22:04 -04:00
Alexander Larsson
f82b6cac5e shell: Always go to original mode when focused window not fullscreen
Right now we only switch mode on activating a fullscreened window.
This has several problems:

* Once you're in fullscreen its hard to switch to a non-fullscreened
  window with alt-tab as you stay in the small resolution.
* If you switch from a fullscreened window to a non-fullscreened
  window and the fullscreened window is destroyed we will not
  restore the original mode (since the window is not
  shell_surface_is_top_fullscreen()
* Its hard to reach a different output on the right with the mouse
  when the mode is smaller that the original, as there is a "gap"
  between the two outputs. So, if you alt-tab to another window
  you can not always reach it.

This is somewhat of a sledge hammer, as it means you can't e.g.
focus a non-fullscreen on one output and have a window fullscreened
on another output. However, trying to restore only the outputs
the new window is on is problematic:

* It may later change output
* We want to see all windows anyway during alt-tab
* Can't reach the other windows with the mouse anyway

So, this seems like an ok solution.
2013-05-28 17:22:01 -04:00
Alexander Larsson
355748e3b5 shell: Use buffer_scale as output scale on fullscreen DRIVER
It may happen that you e.g. fullscreen a 800x600 surface with
buffer_scale 1 (e.g. a 800x600 buffer) on an output that is
otherwise scale 2. In this case we want to temporarily set
the output scale to 1, as we're really scanning out of a
scale 1 buffer. This causes us to e.g. report the input
positions in the right place, etc.

When we restore the original mode we also restore the original
scale.

Note that the scale change is a purely compositor internal change,
to clients it still looks like the output is scale 2.
2013-05-28 17:18:56 -04:00
Alexander Larsson
e32c376776 compositor: Store original output scale
We want this so we can restore the original mode
with the original size (after having been fullscreen).
2013-05-28 16:22:40 -04:00
Alexander Larsson
0b13506ecf compositor: Store modes in physical units
We changed the protocol to always list modes in physical pixel
units (not scaled). And we removed the scaled mode flag. This
just updates the DRM and X11 compositors and the gl and pixman renderers
to handle this.
2013-05-28 16:22:26 -04:00
Alexander Larsson
83368817a7 compositor-x11: Set original mode after current
Otherwise we're pointing the original mode on some uninitialized
value.
2013-05-28 16:15:28 -04:00
Alexander Larsson
73469ed7e6 fullscreen: Add fullscreen testing client
This lets you try fullscreen in different methods, sizes, scales,
translations, etc. You can verify both output and input (via mouse over
of the rectangles).
2013-05-28 16:14:38 -04:00
Alexander Larsson
bcd18d9b09 input: Fix possible crash in clip_pointer_motion
It was erronously using output->current->height in one
place where it should use output->height. This may cause
it to create an invalid clipped coordinate in case of output
scaling or transform, because the next round "prev" would
end up NULL.
2013-05-28 16:14:34 -04:00
Hardening
6a4e8c62e7 Fix name clash in RDP compositor
This patch fixes some name clashes introduced by last patches.
2013-05-28 15:36:20 -04:00
Kristian Høgsberg
82189f7abd config-parser: Add tests for expect behavuor on NULL configs and sections 2013-05-28 15:34:46 -04:00
Mun Gwan-gyeong
7732540f71 config-parser: Avoid null dereference when exiting. (case: weston starts without config file.)
backtrace:
 (gdb) bt
 #0  0xb7704424 in __kernel_vsyscall ()
 #1  0xb757ddde in raise (sig=5) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:42
 #2  <signal handler called>
 #3  weston_config_destroy (config=0x0) at config-parser.c:508
 #4  0xb75cbc0e in x11_destroy (ec=0x93506b0) at compositor-x11.c:1473
 #5  0x0804e0e9 in main (argc=1, argv=0xbffe5354) at compositor.c:3337
2013-05-28 15:30:27 -04:00
Mun Gwan-gyeong
151a52834e config-parser: Avoid null dereference when handling config-parser ( when weston starts without config file. )
backtrace:
 (gdb) bt
 #0  weston_config_next_section (config=0x0, section=0xbfb2b608, name=0xbfb2b618) at config-parser.c:485
 #1  0xb75b1371 in x11_compositor_create (config=0x1, argv=0xbfb2ba44, argc=<optimized out>, use_pixman=0, no_input=0, fullscreen=0, display=0xb75b55f9)
    at compositor-x11.c:1582
 #2  backend_init (display=0x8354490, argc=0xbfb2b9b0, argv=0xbfb2ba44, config=0x0) at compositor-x11.c:1674
 #3  0x0804df7b in main (argc=1, argv=0xbfb2ba44) at compositor.c:3289
2013-05-28 15:30:14 -04:00
Alexander Larsson
edddbd14ac Convert all scales to int32_t
The type changed in the protocol, so update weston for this.
2013-05-28 15:27:45 -04:00
Kristian Høgsberg
14e438c8a2 compositor: Parse config file in main(), only keep weston config object
Now that all backends and modules have been converted to the new
config parser API, we don't have to keep the fd around.
2013-05-26 21:48:14 -04:00
Kristian Høgsberg
115b0f729c cms-static: Don't crash on outputs with NULL name 2013-05-26 21:30:14 -04:00
Kristian Høgsberg
8f6fcbfc2e compositor-x11: Use new config file parser
With the iterator API we can now convert the X11 backend.
2013-05-26 21:21:28 -04:00
Kristian Høgsberg
f73f316248 config-parser: Add section iterator API
The X backend needs to iterate through all outputs.
2013-05-26 20:50:53 -04:00
Hardening
b8f03aa20e Don't store FreeRDP file descriptors
Weston don't uses the file descriptors from FreeRDP, there's no need
to store them.
2013-05-26 20:11:13 -04:00
Mun Gwan-gyeong
72a3ab7b85 config-parser: Avoid null dereference when handling config-parser
backtrace:
 (gdb) bt
 #0  weston_config_get_section (config=0x0, section=0x8062f31 "keyboard", key=0x0, value=0x0)
     at config-parser.c:265
 #1  0x080535a1 in weston_compositor_init (ec=0x905b690, display=0x9056490, argc=0xbf8bd2f0,
     argv=0xbf8bd384, config_fd=-1) at compositor.c:2819
 #2  0xb75d72bb in x11_compositor_create (config_fd=-1, argv=0xbf8bd384, argc=<optimized out>,
     use_pixman=0, no_input=0, fullscreen=0, display=0x9056490) at compositor-x11.c:1527
 #3  backend_init (display=0x9056490, argc=0xbf8bd2f0, argv=0xbf8bd384, config_fd=-1)
     at compositor-x11.c:1746
2013-05-26 20:07:47 -04:00
Mun Gwan-gyeong
d664196cfb config-parser-test: fix compile error
Add COMPOSITOR_CFLAGS to Makefile.am
2013-05-26 20:04:28 -04:00
Kristian Høgsberg
fc10cc0c65 shell: Remove input panel debug fprintf 2013-05-23 21:47:37 -04:00
Kristian Høgsberg
00fd7b82f0 text-backend: Use new config parser 2013-05-23 21:45:51 -04:00
Kristian Høgsberg
673a889fd8 shell: Use new config parser 2013-05-23 21:42:04 -04:00
Kristian Høgsberg
a30989a47d compositor-drm: Convert to new config parser 2013-05-23 21:41:59 -04:00
Kristian Høgsberg
7bedae1d44 cms-static: Convert cms-static to use new config parser
Almost half of the logic here was about wrestling the silly config parser
API.
2013-05-23 21:41:50 -04:00
Kristian Høgsberg
6a047915c0 compositor: Use new config parser for keyboard options 2013-05-23 21:41:45 -04:00
Kristian Høgsberg
732747114a Add new config parser
The current config parser, parses the ini file and pulls out the values
specified by the struct config_section passed to parse_config_file() and
then throw the rest away.  This means that every place we want to get
info out of the ini file, we have to parse the whole thing again.  It's not
a big overhead, but it's also not a convenient API.

This patch adds a parser that parses the ini file to a data structure and
puts that in weston_compositor->config along with API to query comfig
keys from the data structure.  The old parser is still available, but
we'll transition to the new approach over the next few commits.
2013-05-23 21:25:42 -04:00
Kristian Høgsberg
7c60912cb9 compositor: Make backlight_current int32_t to avoid unsigned overflow
Backlight brightness was wrapping around when decrementing from 0.
2013-05-23 21:00:45 -04:00
Kristian Høgsberg
220819f7b9 compositor-drm: Log failure and which backlight sysfs file we're using 2013-05-23 21:00:45 -04:00
Pekka Paalanen
daaddc6032 compositor-x11: fix default output scale
Default output scale of 256 makes little sense. Actually this is a type
mismatch between wl_fixed and int, probably a leftover from when the
scale factor was proposed as a fixed point number.

Scale 256 probably causes the Window creation to fail, but that actually
leads to a segfault in Mesa libEGL later:

Program received signal SIGSEGV, Segmentation fault.
0  dri2_create_window_surface (drv=0x645060, disp=0x646610, conf=<optimized out>, window=<optimized out>, attrib_list=<optimized out>)
    at platform_x11.c:291

291	   surf->SwapInterval = 1;
Here 'surf' is NULL.

1  0x00007ffff76c0709 in eglCreateWindowSurface (dpy=0x646610, config=<optimized out>, window=58720261, attrib_list=0x0) at eglapi.c:534
2  0x0000000000421549 in gl_renderer_output_create (output=0x673ae0, window=58720261) at gl-renderer.c:1661
3  0x00007ffff41c456b in x11_compositor_create_output (c=0x6388b0, x=0, y=0, width=1024, height=640, fullscreen=0, no_input=0,
    configured_name=0x0, transform=0, scale=256) at compositor-x11.c:928
4  0x00007ffff41c5ca0 in x11_compositor_create (display=0x631950, fullscreen=0, no_input=0, use_pixman=0, argc=0x7fffffffda7c,
    argv=0x7fffffffdd18, config_fd=14) at compositor-x11.c:1596
5  0x00007ffff41c63db in backend_init (display=0x631950, argc=0x7fffffffda7c, argv=0x7fffffffdd18, config_fd=14) at compositor-x11.c:1746
6  0x000000000040fcb7 in main (argc=1, argv=0x7fffffffdd18) at compositor.c:3293

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Cc: Alexander Larsson <alexl@redhat.com>
2013-05-23 11:16:21 -04:00
Kristian Høgsberg
785e1f34c1 rdp: Update output initialization to new API 2013-05-22 21:54:05 -04:00
Hardening
fe36a13a8f rdp: Improve raw surfaces
This patch does miscellanous improvements with raw surfaces:
* some frames markers are sent to identify a single frame made of
multiple surface updates
* we send the dirty sub-rectangles instead of the full bouncing box
* the size of the fragmentation buffer is now honored, so that our big
surface updates don't look like a DoS
* the subtile and image flipping are done in one step (not requiring a
temporary tile)
* we don't care about the size of the dirty region and always use the
preferred codec for surface update
2013-05-22 21:54:00 -04:00
Hardening
c39118be7e rdp: Don't rely on Synchronize packet for first screen refresh
Last FreeRDP don't send Synchronize packets anymore, so send the
first screen refresh when we're "connected". The client cursor is
also disabled during this step.
2013-05-22 21:53:58 -04:00
Hardening
827358e0bd rdp: Fixed codec initialisations
This patch fixes NSC codec initialisation that was not done (an
erronous copy'n paste).
The remoteFx context must be resetted when we go through an activation
sequence
2013-05-22 21:53:55 -04:00
Hardening
7d79dcc56d rdp: Drop unneeded main_seat
With recent changes in shell.c the fake seat is not required to
start a compositor, this patch removes it.
2013-05-22 21:53:51 -04:00
Hardening
a1ce6cd1bc rdp: Fix compilation against FreeRDP and weston
The stream utils of FreeRDP have changed recently, this patch fixes
the compositor compilation against FreeRdp master.
The backend_init() prototype has changed too, this fixes it.
2013-05-22 21:53:46 -04:00