Commit Graph

4875 Commits

Author SHA1 Message Date
John Ralls
41f29032d2 Fix typo from f2ab3af 2012-10-25 10:58:56 -07:00
Matthias Clasen
5aff66f391 Add GDK_VERSION_3_8
This macro is needed for the new AVAILABLE_IN and DEPRECATED_IN
macros.
2012-10-23 17:36:17 -04:00
Jean Parpaillon
247bc3ad69 Fix out of source tree building for gdk/broadway
This patch fix compilation when building out of source tree (gdk/broadway dir).

Signed-off-by: Colin Walters <walters@verbum.org>
2012-10-22 11:30:37 -04:00
Scott Moreau
e5b88f1bdd wayland: Update to reflect protocol changes 2012-10-19 12:21:35 +01:00
Stefano Facchini
0f36b16733 Add gdk version macros for 3.8
https://bugzilla.gnome.org/show_bug.cgi?id=684288
2012-10-17 14:12:57 +02:00
Kristian Rietveld
c7ce4b6b3d quartz: Actually use the window background PATTERN color
Before we used a window's background color, which resulted in corrupted
display in some cases, presumably because we didn't reset the active
pattern. This patch seems to eliminate the observed corruption.
(cherry picked from commit 0e42cf81f1)
2012-10-09 16:19:29 +02:00
Cosimo Cecchi
e09cf6978e gdk: only emit display-opened after the default display has been set
This avoids a case where the display has been opened, but calling
gdk_display_get_default() in the callback doesn't work.

Reviewed-by: Benjamin Otte <otte@redhat.com>
2012-10-08 18:44:09 -04:00
Benjamin Otte
f9ddfa28b8 x11: Put function in header, don't declare them extern 2012-10-06 15:55:30 -04:00
Benjamin Otte
dd3c56d783 gdk: Ignore headers for declared functions 2012-10-06 15:55:30 -04:00
Alexander Larsson
83c66c9c2c Make process_all_updates draw synchronously
By calling XSync in _gdk_x11_display_after_process_all_updates we
effectively make gdk rendering sync, which avoids problems with the
client animations running faster than the Xserver rendering, thus
filling up the X rendering pipes and essentially "locking up" the
Xserver (i.e. you can't even close the offending window because the
WM is starved too).

I verified this worked by making GtkSpinner paint multiple times on my
intel driver (which has some issue making this rendering slow atm),
and without this patch i get severe lag where even window dragging
stops for 5 seconds when i drag the mouse around. However, with the
patch everything is smooth.

https://bugzilla.gnome.org/show_bug.cgi?id=684639
2012-10-02 13:12:49 +02:00
Alexander Larsson
db374a0a87 broadway: Use binary websockets if available 2012-10-01 14:58:57 +02:00
Alexander Larsson
86bcd1c22c broadway: Output message data directly to buffer
This cleans up the code, as well as allows later format
changes for e.g. binary websockets
2012-10-01 14:58:57 +02:00
Alexander Larsson
17aea12417 broadway: Encode urls directly into message buffer
No need for a temporary buffer
2012-10-01 14:58:56 +02:00
Alexander Larsson
95d9b17f35 broadway: Restructure output
Now we queue all output commands in a single buffer, to
ensure we send everything in a single op even for v7plus.
2012-10-01 14:58:56 +02:00
Alexander Larsson
203dd8bf7a broadway: Fix indentation 2012-10-01 14:58:56 +02:00
Alexander Larsson
96e7ff73dd broadway: Detect binary websockets support 2012-10-01 14:58:56 +02:00
Alexander Larsson
7c87684629 broadway: Centralize cmd parsing
This clean up things, as well as prepares for new message formats
such as binary websockets.
2012-10-01 14:58:56 +02:00
Benjamin Otte
8f96966178 window: Fail if the parent window and the visual don't match
They must be on the same screen.
2012-09-28 18:27:49 +02:00
Kristian Rietveld
4ccf8609ab quartz: Fix garbage content when windows are initially mapped
The garbage would be visible if any widget enabled the toplevel
NSView's CALayer in order to do custom native rendering.
(cherry picked from commit 92ea94af5f)
2012-09-28 10:11:16 +02:00
Matthias Clasen
5f9b010b94 Fix gdk docs build
This took far too long: The actual problem turned out to
be an unclosed <SECTION> in gdk3-sections.txt.
2012-09-18 13:54:22 -04:00
Matthias Clasen
e95490c15e GdkWindow: remove reference to a long-removed example 2012-09-18 13:54:22 -04:00
Michael Natterer
1ad25dfb81 quartz: Bug 674108 - Hard crash due to wrong NSAutoreleasePool stacking
Apply patch from Kristian Rietveld which addresses two issues
in gdkeventloop-quartz.c:

This patch moves the autorelease pool drain and introduces protection against
the invalidated ufds. Basically, when we suspect ufds has been invalidated by a
recursive main loop instance, we refrain from calling the collect function.
(cherry picked from commit 79b3326eaa)
2012-09-14 15:22:18 +02:00
Kristian Rietveld
64324a5da0 Implement gtk-primary-button-warps-slider GtkSetting
Make GtkRange honor the setting and implement it in the
quartz backend, it proxies the "click in the scroll bar to"
property from the OS X PrefPane.
2012-09-11 11:19:09 +02:00
Bastien Nocera
42f953eead gdk: s/availible/available/ 2012-09-10 17:39:27 +01:00
Daiki Ueno
7937b5d9f1 gdk: fix GI annotation and document for {map,add}_virtual_modifiers
https://bugzilla.gnome.org/show_bug.cgi?id=677559
2012-09-10 15:03:25 +02:00
Matthias Clasen
eb9223c008 Be more strict in ignoring ineffective modifiers
After my recent fix for this, nautilus was still having problems
telling keeping F10 and Shift-F10 apart. With this change, we are
treating levels with the same symbol like inactive levels, ignoring
them entirely.
2012-09-09 18:28:48 -04:00
John Ralls
f2ab3af20a Protect sectond call of nsevent hasPreciseScrollingDeltas from pre-Lion 2012-09-03 16:56:46 -07:00
Matthias Clasen
314b6abbe8 Try harder to discriminate Shift-F10 and F10
A change in xkeyboard-config 2.4.1 made it so that function keys
now have a shift level which has the same symbol, but 'eats' the
shift modifier. This would ordinarily make it impossible for us
to discriminate between these key combinations.

This commit tries harder to discriminate in 2 ways:
- XKB has a mechanism to tell us when a modifier should not be
  consumed even though it was used in determining the level.
  We now respect such 'preserved' modifiers. This does not fix
  the Shift-F10 vs F10 problem yet, since xkeyboard-config does
  not currently mark Shift as preserved for function keys.
- Don't consume modifiers that do not change the symbol. For
  the function keys, the symbol on the shift level is the same
  as the base level, so we don't consider Shift consumed.

For more background on the xkeyboard-config change, see
https://bugs.freedesktop.org/show_bug.cgi?id=45008

https://bugzilla.gnome.org/show_bug.cgi?id=661973
2012-09-01 23:25:18 -04:00
Alexander Larsson
29a42085c6 Remove gdk_window_flush_if_exposing as its not needed anymore
We no longer support modifying GdkWindow hierarchies during
expose events. This is not working anymore anyway as the
flush operation now does not push already rendered pixels
in the flushed window from the double buffer to the window.

https://bugzilla.gnome.org/show_bug.cgi?id=679144
2012-08-23 16:31:31 +02:00
Alexander Larsson
e112cdacd4 Fix flashing in non-double-buffered widgets
Avoid copying back partially drawn double-buffer data
when flushing to avoid flicker. This means non double
buffered widgets must draw opaque pixels in its expose
handlers, and that you are not allowed to use direct
rendering (or modify GdkWindow pos/size/order) from
inside the expose handler of a double buffered widget.

See https://bugzilla.gnome.org/show_bug.cgi?id=679144 for more
details
2012-08-23 16:31:30 +02:00
Alexander Larsson
820b0cafe0 gdkwindow.c: Fix up window debug code
Make this build and fully print clip regions.
2012-08-23 12:16:43 +02:00
Alexander Larsson
04811d9483 Avoid unnecessary window flushes
The code was calling _gdk_window_ref_cairo_surface in a few places
where the intent was not to read/write to the surface, but just look
at its type (to e.g. create a similar surface). This is bad, as that
operation causes a flush which may cause unnecessary work and/or
flashing. Instead we just get the impl surface in these cases.
2012-08-23 12:16:43 +02:00
Michael Natterer
78506bd604 quartz: add evil casting to make sure time wraps correctly on 32bit machines
get_time_from_ns_event(): apply patch from Michael Hutchinson which
makes sure the returned guint32 wraps correctly on 32 bit machines
when the uptime exceeds 2^32 ms.
2012-08-23 09:31:12 +02:00
John Ralls
2cb739a2d5 Implement gdk_quartz_keymap_lookup_key 2012-08-22 14:39:11 -07:00
Matthias Clasen
6fe0fbd4e2 Leave GDK_THREADS_ENTER/LEAVE visible for now
Not defining these macros at all causes harsh build breakages.
Better to leave them defined (but documented as deprecated) for now.
Everybody will still get the deprecation warnings for the underlying
gdk_threads_enter/leave.

We can hide the macros again later on when the world has had some
time to port off GDK threads.
2012-08-06 08:34:46 -04:00
Matthias Clasen
8f55b2775a Expand the thread deprecation documentation
The story is slightly different for applications vs libraries;
make it clear that libraries should continue using the lock so
we don't break applications that haven't been ported to the
'single thread' model yet.
2012-08-01 10:26:17 +02:00
Matthias Clasen
b936666b52 Improve threading documentation
This commit just adds a small section to the threading documentation
about the deprecation. More is needed here, including a migration
example.
2012-07-30 18:01:47 +02:00
Matthias Clasen
0ac56e9dcc gdk: Deprecate thread functions
This commit deprecates gdk_threads_init, gdk_threads_enter,
gdk_threads_leave and gdk_threads_set_lock_functions. Using GTK+
from multiple threads does not work at all on Windows, and is
problematic on other platforms as well. We want to move to a world
where all GTK+ calls are made from the main thread.
Use g_main_context_invoke, g_idle_add and related functions if you
need to schedule GTK+ calls from other threads.

http://bugzilla.gnome.org/show_bug.cgi?id=680754
2012-07-30 18:01:47 +02:00
Matthias Clasen
144a5687c9 gdk: Don't use GDK_THREADS_ENTER/LEAVE macros internally
These are just wrappers for the functions, and we want to
deprecate them. Stopping to use them internally is a good
first step.
2012-07-30 18:01:47 +02:00
Rob Bradford
7c51d67e7c wayland: Fallback to setting transient windows if no seat available
If we don't have a wl_seat - because a grab hasn't been initialised by GTK+
then fallback to making the shell surface transient to the parent rather than
a popup surface.
2012-07-18 16:16:56 +01:00
Rob Bradford
8a39d2269e wayland: Don't compare against GdkWindowTypeHint as a bitmask
The hint was being compared as a bitmask which means types that were not in
the list were being erroneously matched
2012-07-18 16:08:36 +01:00
José Dapena Paz
c5ef4e660b wayland: Add default settings implementation for Wayland backend.
Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-07-17 11:31:54 +01:00
José Dapena Paz
33e928e472 wayland: Initial version of keyboard key event handling
Review comment: I think the implementation of the vfuncs in gdkkeys-wayland.c
depend on that we're using the keysysm as the hardware keycode. I think that
needs to be evaluated for the future. But for now this patch gives reasonably
complete keyboard input.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-07-16 20:11:41 +01:00
José Dapena Paz
d2c66e5afd wayland: Hook up _get_num_lock / _get_caps_lock to read from XKB state
Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-07-16 20:11:41 +01:00
Rob Bradford
bef037f5d2 wayland: Remove unused function declaration 2012-07-16 20:11:41 +01:00
Rob Bradford
b5773b89cf wayland: Remove annoying whitespace 2012-07-16 20:11:41 +01:00
José Dapena Paz
a4c80bd9cb wayland: Create and expose an xkb_state on the keymap object
This is then logically associated with the input device since each (keyboard)
input device has its own keymap.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-07-16 20:11:41 +01:00
José Dapena Paz
d2267824b3 wayland: Refactor the keymap handling so it is associated with device
Although GDK expects the keymap to be associated with the display under
Wayland this is really associated with the input device so expose this by
finding the first keyboard device.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-07-16 20:11:41 +01:00
Rob Bradford
21f4b1cb35 wayland: Use the correct union member for axis events
Otherwise we end up overriding other members of the struct (in this case the
device pointer) and generate an error.
2012-07-16 15:38:09 +01:00
José Dapena Paz
a93f246056 wayland: implementation of pointer_handle_axis.
We translate wayland pointer axis events to GDK smooth scroll events, to
implement pointer_handle_axis events.

https://bugzilla.gnome.org/show_bug.cgi?id=679986
Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-07-16 15:37:53 +01:00