Commit Graph

4641 Commits

Author SHA1 Message Date
Rui Matos
db2eb85e4a x11: Cancel _NET_WM_MOVERESIZE if we get a matching ButtonRelease
This implements the following part of the EWMH spec:

"The special value _NET_WM_MOVERESIZE_CANCEL also allows clients to cancel the
operation by sending such message if they detect the release themselves
(clients should send it if they get the button release after sending the move
resize message, indicating that the WM did not get a grab in time to get the
release)."

In particular, it fixes the case of clicking widgets that use
gdk_window_begin_[resize|move]_drag*() and the click "sticking", i.e. the
mouse button getting released but the resize or move operation remaining in
effect.

https://bugzilla.gnome.org/show_bug.cgi?id=669208
2012-02-09 23:44:09 +01:00
Alexander Larsson
251cffb638 Fix transparency handling with non-double-buffered drawing
Sometimes we need to read back the window content into our double
buffer due to rendering a window with alpha when there is
no implicit paint or it has been flushed due to non-db drawing
before.

However, in this case we can't use gdk_cairo_set_source_window as
it might trigger an implicit paint flush as we detect what we
think is a direct non-double buffered window draw operation, which
will flush the implicit paint operation that we're just setting up.

To fix this we use the raw gdk_window_ref_impl_surface operation
to get the source surface.
2012-02-09 21:14:07 +01:00
Alexander Larsson
5d9736fe13 Fix non-double-buffered drawing
There was a sign issue in a coordinate transform that made us
flush the wrong region when flushing an implicit paint.
The non-double buffered drawing would then be drawn over the
right area, but then at the end of the implicit paint this
would be overdrawn with the area we didn't properly remove
from the implicit paint.

Also, the translation from window coords to impl window
coords is now done before removing any active double
buffered paints, as these are also in impl window coords.
2012-02-09 21:14:07 +01:00
Alexander Larsson
fed1cfb122 Make the default background for GdkWindows transparent
With the changes in default CSS to make the default background transparent
we ran into issues where intermediate GdkWindow (for instance the
view_window in GtkViewport) where we didn't set an explicit background
(because before they were always covered). So instead of showing throught
the transparent windows were showing the default backgroind of the intermediate
window (i.e. black).

With this change we also needed to fix GtkViewport, as it was previously
relying on the bin and view windows to cover widget->window so that the
border was not visible if shadow_type was NONE.
2012-02-09 16:39:23 +01:00
Michael Meeks
0481fbf7ce broadway: terminate v7 input to avoid parsing uninit memory. 2012-01-31 10:39:01 +00:00
Matthias Clasen
585a6652d5 Use G_SOURCE_CONTINUE/REMOVE
Now that GLib provides these macros, we should use them
to make the code more readable.
2012-01-30 19:12:27 -05:00
Kristian Høgsberg
12e661c801 wayland: Fix return type from gdk_wayland_window_configure()
Should be void.  Copy and paste error.
2012-01-30 09:07:24 -05:00
Kristian Høgsberg
aae9a71986 wayland: Also synthesize a configure event from gdk_window_wayland_move_resize 2012-01-29 07:32:44 -05:00
Carlos Garcia Campos
bc5d8da0c6 gdkevents: Use symbolic names for button numbers 2012-01-27 09:47:42 +01:00
Carlos Garcia Campos
2890ac842f gdk: Add macros for left, middle and right buttons
https://bugzilla.gnome.org/show_bug.cgi?id=668688
2012-01-27 09:47:42 +01:00
Michael Natterer
90b991dd13 quartz: s/gdk_cursor_ref/g_object_ref/ 2012-01-26 10:37:12 +01:00
Michael Natterer
3ca7ec693f Bug 667691 - implement gdk_window_restack() for Quartz
Apply patch from Paul Davis which implements this missing function.
(cherry picked from commit e1c107a094)
2012-01-26 10:25:47 +01:00
Dieter Verfaillie
fe1907708c win32: fix gdk_win32_window_raise
When calling gtk_window_present(), gdk_win32_window_raise did not
actually raise the window anymore. Replacing BringWindowToTop() with
SetForegroundWindow() fixes this.

During testing, we also discovered that sometimes SetForeGroundWindow()
will (correctly) refuse to raise the window and fail(for example: sometimes
when dragging a different application at the time of a gtk_window_present()
call). To prevent a GdkWarning from being produced, usage of the API_CALL
macro has been removed for this case.

Additional goodies of SetForeGroundWindow:
- it brings the window to the front when the process owning the
  window to raise is the foreground process (for example when
  gtk_window_present is called from a GtkStatusIcon's activate
  signal handler)
- it limits itself to flashing the task bar button associated
  with the window if the process owning the window to raise
  is *not* the foreground process (for example when gtk_window_present
  is called from a g_timeout_add callback function)

https://bugzilla.gnome.org/show_bug.cgi?id=665760
2012-01-25 20:32:50 +01:00
Javier Jardón
104d9cab37 gdkapplaunchcontext: Add tags to code example 2012-01-25 17:36:57 +00:00
Alexander Larsson
fa6ad2ca04 broadway: Properly handle masked websocket messages
Thanks to Rafal Luzynski for pointing this out.

https://bugzilla.gnome.org/show_bug.cgi?id=656521
2012-01-25 11:47:16 +01:00
Alexander Larsson
7ec927a386 Fix visibility notification event reporting
We were checking the event mask for GDK_VISIBILITY_NOTIFY,
not GDK_VISIBILITY_NOTIFY_MASK, which was clearly a typo.
2012-01-20 11:01:49 +01:00
Michael Natterer
0ea1924494 quartz: add virtual modifiers already in GDK, just as X11 does it
Key event states  will now always contain GDK_META_MASK in addition
to GDK_MOD2_MASK.
(cherry picked from commit d915d17ff6)
2012-01-19 16:29:41 +01:00
Kristian Høgsberg
b9190c7fe9 wayland: Destroy shell surface as we destroy the surface 2012-01-19 09:57:43 -05:00
Kristian Høgsberg
4c79e25915 wayland: Report middle and right buttons correctly
The linux evdev button codes have right as 274 and left as 273.
2012-01-18 12:04:18 -05:00
Rob Bradford
29641ecd07 wayland: Update modifiers handling to match new semantics
Due to changes in the behaviour of the virtual modifiers around MOD1 the
implementation of the map_virtual_modifiers vfunc was mangling the modifiers
and making keybindings not work correctly.

This change updates the implementation to match the X11 implementation's
behaviour.
2012-01-18 16:32:44 +00:00
Kristian Høgsberg
b9509ec15d wayland: Handle request for selection atoms when there's no selection 2012-01-17 11:10:59 -05:00
Rob Bradford
dba9c2e5a7 wayland: Adapt move_resize vfunc implementation to match semantics
Callers of this function were passing in -1, -1 for the width and height if
they just wanted the window moving - rather than the size changing. We need to
respect that behaviour and don't try and set the width/height to those
dimensions.

Now pop-up windows (ala combo-boxes) work!
2012-01-17 15:05:03 +00:00
Alexandre Rostovtsev
e2053a582a Add Since: to gdk_x11_device_get_id(), gdk_x11_device_manager_lookup(), gdk_x11_window_set_utf8_property() docs
https://bugzilla.gnome.org/show_bug.cgi?id=667730
2012-01-16 18:08:16 -05:00
Kristian Høgsberg
7328cc73aa wayland: Set GdkWindow focused state based on keyboard focus 2012-01-16 15:36:28 -05:00
Kristian Høgsberg
5f07e937c8 wayland: Implement client side keyboard repeat 2012-01-16 15:36:27 -05:00
Rui Matos
f0a80fa308 x11: Fix the _NET_SUPPORTING_WM_CHECK window fetch to be spec compliant
"The child window MUST also have the _NET_SUPPORTING_WM_CHECK property set to
the ID of the child window. […] If the _NET_SUPPORTING_WM_CHECK window on the
client window is missing or not properly set, clients SHOULD assume that no
conforming Window Manager is present."

This commit implements that, which allows us to not have to do a
XGetWindowProperty() every N seconds when running under a compliant WM.

This is also a more correct fix for the bug handled in commit
daf29bffed.

https://bugzilla.gnome.org/show_bug.cgi?id=666921
2012-01-16 15:38:33 +00:00
Rob Bradford
08f5483fb7 wayland: Free the internal selection data when the selection is cleared 2012-01-13 16:50:47 +00:00
Rob Bradford
1e0b22c176 wayland: Fix memory handling for the selection callbacks 2012-01-13 16:50:47 +00:00
Rob Bradford
368d6c50b7 wayland: Add basic API for setting and clearing the selection on the device 2012-01-13 16:50:47 +00:00
Rob Bradford
cd795de6bf wayland: Expose basic mechanism for getting selection content by callback
This version has a couple of TODOs/FIXMEs:

* We should do something better than g_io_channel_read_to_end
* Need to check the mime type is valid
2012-01-13 16:50:47 +00:00
Rob Bradford
9d90a17a7c wayland: Add call to get types available for the selection as atoms 2012-01-13 16:50:47 +00:00
Rob Bradford
fe3f275945 wayland: Remove unused variables to silence compiler warning 2012-01-13 16:50:47 +00:00
Kristian Høgsberg
0e10fae36c wayland: Set surface type based on GdkWindow hint 2012-01-13 09:50:38 -05:00
Rob Bradford
9e29ef5f3b wayland: Update to new SHM buffer format type 2012-01-13 11:36:36 +00:00
Rob Bradford
e7e86ba5f4 wayland: Remove unused variable from grab implementation 2012-01-12 13:48:57 +00:00
Rob Bradford
0aa210866c wayland: Fix compilation warning for destroy function implementation 2012-01-12 13:48:57 +00:00
Rob Bradford
f791687d3b wayland: Fix implementation of gdk_atom_name 2012-01-12 13:48:57 +00:00
Rob Bradford
7f404a1fee wayland: Remove unused variable 2012-01-12 13:48:46 +00:00
Patrick Welche
2ceb092afc Non-XInput2 build fix
The part in gdkwindow-x11.c which uses XIEvent and friends is "protected"
by HAVE_XGENERICEVENTS, i.e., XGetEventData() has been found. (Xlib.h)

XIEvent and friends are defined in <X11/extension/XInput2.h> which is
included by gdkdisplay-x11.h if XINPUT_2 is defined.

The patch makes sure XIEvent is only used if XINPUT_2 is defined.

https://bugzilla.gnome.org/show_bug.cgi?id=667534
2012-01-10 13:54:22 +00:00
Rob Bradford
1f023cd2b1 wayland: Constrain the window configure requests to the window's geometry
When we receive a configure event from Wayland telling us to resize our
surface we check against the geometry constraints for the window to ensure we
do not resize below the minimum and maximum limits.
2012-01-09 17:19:34 +00:00
Rob Bradford
4107ef0b93 wayland: Implement set_geometry_hints vfunc
Our trivial implementation simply saves the passed in parameters into the
Wayland private data structure.
2012-01-09 17:19:34 +00:00
Rob Bradford
eedd1ec92f wayland: Make the resize and move functions use gdk_device_ungrab
Now that grab and ungrab vfuncs are implemented on GdkDevice then we can use
gdk_device_ungrab to break the implicit grab created by the button press that
triggered the resize and move.
2012-01-09 16:00:14 +00:00
Kristian Høgsberg
e5283122fd wayland: Add implementations for the device_grab / device_ungrab vfuncs
This allows the correct implementation of breaking the grab in pointer driven
resize and move.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
2012-01-09 15:59:02 +00:00
Matthias Clasen
ef1bc2923e Add more tests for GdkRGBA parsing
These examples are taken from bug 667485.
2012-01-09 00:31:20 -05:00
Matthias Clasen
e5e6d25a50 Tighten up GdkRGBA parsing
gdk_rgba_parse was accepting too much nonsense, as pointed out
in bug 667485.
2012-01-09 00:31:20 -05:00
Matthias Clasen
b3f2b41567 Rename rgba test file
Not testing GdkColor here, anymore.
2012-01-07 19:02:48 -05:00
Matthias Clasen
1e867a94a2 Use g_slice_dup
This saves some manual copying.
Pointed out in bug 667473.
2012-01-07 19:00:47 -05:00
Matthias Clasen
2b16ec9f14 Add a test for gdk_rgba_copy 2012-01-07 19:00:32 -05:00
Rob Bradford
47146dacff wayland: Break an implicit grab when asking to be resized
An implicit grab is created inside GTK+ when the button is pressed down on a
window. The semantics of wl_shell_surface_resize means that you don't get a
corresponding release event that would ordinarily break the implicit grab. So
we must do it as part of the resize request.
2012-01-06 16:58:06 +00:00
Rob Bradford
675b2fddcb wayland: Make the event source use _gdk_display_get_next_serial 2012-01-06 16:58:05 +00:00