Commit Graph

6307 Commits

Author SHA1 Message Date
Ting-Wei Lan
3955d93e9d Fix return value error in gdk_window_set_pass_through
https://bugzilla.gnome.org/show_bug.cgi?id=751099
2015-06-17 21:36:35 +08:00
Jonas Ådahl
0dab37c78f wayland: Always request transient commit when mapping subsurface
A subsurface positioning operation only takes effect when the parent
surfaces state is applied. If a subsurface is mapped and positioned, but
the parent surface state is not immediately committed, the relative
position of the subsurface is undefined and may be placed incorrectly.

To avoid this undefined state, always request that the parent surface
should be committed after mapping a subsurface so that the position
operation will take effect.

https://bugzilla.gnome.org/show_bug.cgi?id=751098
2015-06-17 17:41:31 +08:00
Christian Hergert
213b92e644 gdkwindow: avoid updating background pattern if it matches previous
Background patterns are often updated when style changes. In many cases,
the new pattern will match the previous. We can optimize out the
invalidation that will occur upon resetting the same pattern.
2015-06-16 14:40:09 -07:00
Alexander Larsson
4c3eece663 gdk: Add gdk_window_set_pass_through
An pass_through window is something you can draw in but does not
affect event handling. Normally if a window has with no event mask set
for a particular event then input events in it go to its parent window
(X11 semantics), whereas if pass_through is enabled the window below
the window will get the event. The later mode is useful when the
window is partially transparent. Note that an pass-through windows can
have child windows that are not pass-through so they can still get events
on some parts.

Semantically, this behaves the same as an regular window with
gdk_window_set_child_input_shapes() called on it (and re-called any
time a child is changed), but its far more efficient and easy to use.

This allows us to fix the testoverlay input stacking test.

https://bugzilla.gnome.org/show_bug.cgi?id=750568

https://bugs.freedesktop.org/show_bug.cgi?id=90917
2015-06-15 10:56:45 +02:00
Matthias Clasen
7aec96b95f Remove unused variables 2015-06-13 21:10:26 -04:00
Matthias Clasen
5a446284b7 Ensure a variable is initialized
clang complained about transient_for being used uninitialized.
2015-06-13 21:10:25 -04:00
Matthias Clasen
577e9a33bb Remove an unused variable 2015-06-13 21:10:25 -04:00
Matthias Clasen
85a6cafd81 broadway: Avoid compiler warnings
clang doesn't like self-assignment.
2015-06-13 21:10:25 -04:00
Ting-Wei Lan
41b6993a66 Fix 'void function should not return void expression' warning for clang
https://bugzilla.gnome.org/show_bug.cgi?id=750888
2015-06-13 23:00:23 +08:00
Jonas Ådahl
85635457bc wayland: Improve guessing of popup placement for detached popup menus
If a menu was not attached to any widget, we try to calculate its
position given where the grabbed pointer is and what window has its
focus. Previously we failed to do so if a "transfer window" was used
for the grab, and this patch adds a code path that, if the menu window
itself didn't have the grab, look for the transfer window and get the
grab device from there.

https://bugzilla.gnome.org/show_bug.cgi?id=748951
2015-06-10 11:28:32 +08:00
Jonas Ådahl
9e464252c0 wayland: Don't try to guess the popup menu placement when it was set
If a position was already explicitly set, don't try to guess the
position of popup menus by looking at the pointer position, just use
the set coordinates.

https://bugzilla.gnome.org/show_bug.cgi?id=748951
2015-06-10 11:28:32 +08:00
Jonas Ådahl
0f47d1bac4 wayland: Position popups relative to the parent surface
According to the xdg-shell protocol specification the (x, y) coordinates
passed when creating a popup surface is relative to top left corner of
the parent surface, but prior to this patch, if the parent surface
was an xdg_surface, we'd position it relative to top left corner of the
window geometry of that xdg_surface.

https://bugzilla.gnome.org/show_bug.cgi?id=749717
2015-06-10 10:50:12 +08:00
William Hua
d37f94a524 mir: keep reference on queued events 2015-06-02 15:14:27 -04:00
William Hua
f1c11740c1 mir: gdk_mir_window_impl_set_surface_type 2015-06-02 15:14:27 -04:00
William Hua
e1c958e70d mir: Create the correct surface 2015-06-02 15:14:27 -04:00
William Hua
a57636f057 mir: Remove redundant calls 2015-06-02 15:14:27 -04:00
William Hua
aebac40d38 mir: log input events properly 2015-06-02 15:14:27 -04:00
William Hua
e6b3bae787 mir: Resolve warnings 2015-06-02 15:14:27 -04:00
William Hua
a43efc6655 mir: Update cursor position 2015-06-02 15:14:26 -04:00
William Hua
d43f5258ff mir: Remove child window rendering hack 2015-06-02 15:14:26 -04:00
Carlos Garnacho
b84d9ea7ff wayland: Move DnD grab breaking function into gdkdevice-wayland.c
This has little to do with GdkDragContext, and a lot to do with
the GdkDevice that triggered it, seems to make more sense in
gdkdevice-wayland.c.
2015-06-02 18:09:49 +02:00
Carlos Garnacho
d34b1225eb wayland: Split keyboard/button modifiers internally
On wl_keyboard.key/modifiers, we're just forgetting about currently
pressed mouse buttons. Fix this by storing button and key modifiers
separately, and put these together when creating the GdkEvents.
2015-06-02 17:31:38 +02:00
Matthias Clasen
fdb9a8e142 x11: Fix compiler warnings
Fix warnings due to -Wdeclaration-after-statement and -Wshadow.
2015-06-02 09:08:14 -04:00
Matthias Clasen
393df9f7e1 wayland: Avoid compiler warnings
Fix warnings due to -Wdeclaration-after-statement and -Wshadow.
2015-06-02 09:08:14 -04:00
Krzesimir Nowak
39f91d7cdb gdk: Fix a typo 2015-05-22 14:39:53 +02:00
Matthias Clasen
9dad9378f2 Fix primary monitor determination with XRANDR 1.5
This was an oversight in the previous patch.
2015-05-22 06:56:23 -04:00
Dave Airlie
e670720d19 gtk3: add randr 1.5 monitor support
This patch introduces support for using the newly introduced
monitor objects in the XRandR protocol. These objects are meant
to be used to denote a set of rectangles representing a logical
monitor, and are used to hide details like monitor tiling and
virtual gpu outputs.

This uses the new objects instead of crtc/outputs objects when
they are available to create the monitor lists. X server 1.18
is required on the server side for randr 1.5.

https://bugzilla.gnome.org/show_bug.cgi?id=749561
2015-05-21 23:09:04 -04:00
Руслан Ижбулатов
26c24328d5 GDK: Add cursor theme support to W32 backend
Load themed cursors from the same places they are loaded on freedesktop systems,
but use W32 API functions to do so (works for .cur/.ani cursors instead of X
cursors).

Refactor the code for cursor handling. Prefer loading cursors by name.

Do not load actual cursors when loading the theme. Find the files and remember
the arguments/calls for loading them instead. Keeping HCURSOR instance in the
hashmap would result in multiple GdkCursors using the same HCURSOR. Given that
we use DestroyCursor() to off them, this would cause problems (at the very
least - DestroyCursor() would fail).

Store GdkCursor instances in a cache. Update cached cursors when theme changes.

Recognize "system" theme as a special (and default) case. When it is set,
prefer system cursors and fall back to Adwaita cursors and (as a last resort)
built-in X cursors. Otherwise prefer theme cursors and fall back to system and
X cursors.

Force GTK to use "left_ptr" cursor when no cursor is set. Using NULL makes
it use the system default "arrow", which is not the intended behaviour when
a non-system theme is selected.

Ignore cursor size setting and query the OS for the required cursor size, as
Windows (almost) does not allow setting cursors of arbitrary size.

https://bugzilla.gnome.org/show_bug.cgi?id=749287
2015-05-20 08:42:24 +00:00
Руслан Ижбулатов
641fbd86d7 GDK: Use GdkCursor objects to keep track of W32 cursors, not HCURSOR
In particular this means that cursors are disposed of by the way of
g_object_unref(), not DestroyCursor (which is documented to not to be
used on certain kinds of cursors, and we can't tell which is which).

It should also alleviate any concerns about destroying cursors that
are still in use by other windows, except for cases where we would
somehow get our hands on a HCURSOR that someone else is using and we
make a GdkCursor out of it and later unref and finalize it while it
is still in use.

It also removes the need to call CopyCursor(), which makes animated
cursors into non-animated ones as a side-effect (supposed to be a bug,
but try explaining that to MS). Now cursors should be animated (if
the are set up as such in the OS).

https://bugzilla.gnome.org/show_bug.cgi?id=697477
2015-05-20 08:40:43 +00:00
Jonas Ådahl
7fef713224 wayland: Use on globals closure for loading cursor themes
Instead of putting a 'load cursor themes' call when receiving an wl_shm
global, make it a closure that is prepared during initialization.

https://bugzilla.gnome.org/show_bug.cgi?id=719819
2015-05-20 11:45:13 +08:00
Jonas Ådahl
4e9be39518 wayland: Add global object depedency tracking
Some features need certain globals to initialize. In order to deal with
these dependencies, add a way to postpone closures that depend on a
certain set of globals, that later will be invoked when required
globals are all received.

https://bugzilla.gnome.org/show_bug.cgi?id=719819
2015-05-20 11:45:13 +08:00
Jonas Ådahl
181e4399f6 wayland: Don't round trip recursively during initialization
Instead use asynchronous round trips that is synchronized in the end of
the initialization. This makes it easier to track state, as we won't
dispatch arbitrary Wayland messages while processing globals.

https://bugzilla.gnome.org/show_bug.cgi?id=719819
2015-05-20 10:59:47 +08:00
Pietro Gagliardi
3c8b80dce2 Implemented most of the GDK named cursors on Mac OS X.
Only "wait" and "all-scroll" are not implemented properly. OS X does not
seem to have a proper interface to either cursor. Approximations are used
instead; see the code.

See bug 749178.
2015-05-16 17:11:44 -04:00
Matthias Clasen
be9915b16a quartz: Support css cursor names
We want these to work across platforms, so do a best-effort
approximation. We could do much better here by copying what
webkit does.

https://bugzilla.gnome.org/show_bug.cgi?id=749178
2015-05-11 22:29:07 -04:00
Matthias Clasen
62b858cf0f Avoid a critical under weston
The ordering of globals in connection setup under weston
is different from mutter, and we end up creating a the
dnd window before any outputs are present. Don't cause
a critical warning in that case.
2015-05-11 22:13:07 -04:00
Lars Uebernickel
a8e5cacb91 Allow overriding WM_CLASS from the command line
Even when the program itself calls gdk_set_program_class(). There's
currently no way for this function to be called without breaking gdk's
--class command line option, because you cannot call it before
gtk_init().

https://bugzilla.gnome.org/show_bug.cgi?id=747634
2015-05-10 22:40:37 -04:00
Philip Chimento
0c4deb656e quartz: Non-implementation of GdkGLContext
This makes sure the Quartz backend returns an error when asked to create
a GL context, rather than crashing because of a NULL vfunc.

https://bugzilla.gnome.org/show_bug.cgi?id=740199
2015-05-09 23:59:29 -04:00
Matthias Clasen
647f0e6025 docs: Show less ugly X cursors
Don't list examples in the gdk_cursor_new_for_display() docs,
since we now have a list of recommended names for the
from_name() call.
2015-05-08 14:21:11 -04:00
Matthias Clasen
7d83edd4e0 Update docs 2015-05-08 13:34:25 -04:00
Matthias Clasen
5434609b21 Wayland: Make css cursor names work
Map css cursor names to traditional X cursor names to increase
our chance of finding a good cursor in the cursor theme.
2015-05-08 13:34:25 -04:00
Matthias Clasen
17cd3c3218 X11: Make css cursor names work
Map css cursor names to traditional X cursor names to increase
our chance of finding a good cursor in the cursor theme.
2015-05-08 13:34:25 -04:00
Matthias Clasen
b1e10f5312 Wayland: trivial reshuffle
Avoid a forward declaration by moving things around.
2015-05-08 13:34:25 -04:00
Lionel Landwerlin
724cc00f9b gdk: define GdkRectangle structure for introspection scanning
https://bugzilla.gnome.org/show_bug.cgi?id=748833
2015-05-08 11:47:51 +01:00
William Hua
6a51ac59f0 mir: handle generic input events 2015-05-06 10:27:03 -04:00
Руслан Ижбулатов
4c06d08e2d W32: Add a mapping for "left_ptr_watch" cursor
This is purely to support gdk_cursor_new_from_name().
In particular, its counterpart, gdk_cursor_new_for_display(), will not
be affected, because there's no GDK_LEFT_PTR_WATCH cursor type,
and because i don't have a fallback cursor bitmask for gdk/win32/xcursors.h
2015-05-04 17:18:35 +00:00
Руслан Ижбулатов
79c863c595 Use GDK_KEY_KP_Decimal instead of GDK_KP_Decimal
Fixes the FTBFS introduced in 578043f97e
2015-05-04 15:32:22 +00:00
Matthias Clasen
71bd0b05ad docs: Add a note about button 4 & 5 2015-05-02 11:55:57 -04:00
Matthias Clasen
2feaf8f970 xi2: Don't set button mask 4 and 5
We interpret buttons 4-7 as old-school scroll events, so it does
not make sense to add these to the mask. Also fix an off-by-one
in the loop here, buttons_mask is 1-based.
2015-05-02 11:55:57 -04:00
Matthias Clasen
578043f97e win32: Support the decimal point on the keypad
Based on a patch by John Emmas.
2015-05-01 07:03:49 -04:00
Руслан Ижбулатов
1432d23e98 Fix use-after-free in gdk_window_end_paint()
It's a miracle that this code ever worked.
2015-04-30 20:43:18 +00:00