Commit Graph

6386 Commits

Author SHA1 Message Date
John Ralls
c55ff6e41f Bug 736125 - The default gtk accelerator mod mask does not include all default backend modifiers 2015-08-25 15:54:58 -04:00
Jonas Ådahl
32cd1a7447 wayland: Only bind supported unstable pointer gestures global
As the protocol is still considered unstable (meaning not backward
compatible), we should, as stated in the protocol, only bind the version
advertised is the version we implement.

https://bugzilla.gnome.org/show_bug.cgi?id=753856
2015-08-21 10:04:02 +08:00
Carlos Garnacho
25557c1c5d gdkevent: Hold refs to device/source_device
The extra reference will be held from GdkEventPrivate data, so there's
a common place to all events. Without this, events queued after devices/
capabilities disappear (eg. on TTY switch) might hold invalid pointers.
Windowing level operations on those devices (queries, grabs...) are
expected to fail at that time, but we should hold meaningful data for
the regular event handling paths.

https://bugzilla.gnome.org/show_bug.cgi?id=753185
2015-08-19 22:13:08 +02:00
Jonas Ådahl
e1fd87728d wayland: Use g_get_prgname() to get the xdg_surface.set_app_id string
Prior to this patch, the ID of the GtkApplication was always used for
clients which were GtkApplications. This would only be guaranteed to be
correct for D-Bus activatable programs. As a result, all
non-D-Bus-activatable applications would set the wrong ID making the
shell unable to find the corresponding .desktop file.

This change makes it so that the GDK backend always uses the name
passed to g_set_prgname, or the default value if not explicitly set, as
this more often corresponds to the .desktop file.

This means that in order to make D-Bus activatable applications set the
correct application ID, they must, for now, manually call
g_set_prgname() with their application ID (basename of the .desktop
file).

If g_get_prgname() returns NULL, fallback to gdk_get_program_class()
even though it will most likely never be correct according to the
xdg_surface.set_app_id specification.

https://bugzilla.gnome.org/show_bug.cgi?id=746435
2015-08-18 08:45:12 +08:00
Matthias Clasen
b437f89c05 Add a note to gdk_screen_get_width/height_mm
The values returned by these functions are not very well defined,
recommend to use the monitor dimensions instead.
2015-08-15 22:20:16 -04:00
Carlos Garnacho
02f3fe0671 wayland: calculate screen physical size
A simple calculation is done so far (assuming monitor areas never overlap)
so gdk_screen_get_width/height_mm return meaningful values.

https://bugzilla.gnome.org/show_bug.cgi?id=753621
2015-08-15 22:11:10 -04:00
Ray Strode
83c25169e8 Revert "wayland: require WAYLAND_DISPLAY be set to open wayland display"
This reverts commit 35489f5d31.

It snuck in when i was trying to push

commit f4d2022d46
2015-08-14 11:24:44 -04:00
Ray Strode
f4d2022d46 wayland: change wl_log level to G_LOG_LEVEL_DEBUG
wl_log() currently logs using G_LOG_LEVEL_ERROR
(which is fatal). The wayland client library doesn't
expect this behavior. It uses wl_log to log recoverable
errors.

This commit changes the log level to G_LOG_LEVEL_DEBUG
instead.

https://bugzilla.gnome.org/show_bug.cgi?id=753635
2015-08-14 11:06:48 -04:00
Ray Strode
35489f5d31 wayland: require WAYLAND_DISPLAY be set to open wayland display
The wayland client libraries now require WAYLAND_DISPLAY be set
to use them.

See:

http://cgit.freedesktop.org/wayland/wayland/commit/?id=fb7e13021730d0a5516ecbd3712ea4235e05d24d

This commit makes _gdk_wayland_display_open bail early if
WAYLAND_DISPLAY is unset, just as it does for XDG_RUNTIME_DIR.
2015-08-14 10:28:31 -04:00
Руслан Ижбулатов
4a26366ff2 GDK W32: Add missing commas 2015-08-14 12:12:01 +00:00
Carlos Garnacho
45d15b302e wayland: Implement touchpad gesture events
On wayland, the gestures protocol defines a wl_pointer_gestures global
object, that will match in number with wl_seats, swipe and pinch
interfaces can be obtained from it, which events are translated into
GdkEventTouchpadSwipe/Pinch events.
2015-08-12 23:20:25 +02:00
Carlos Garnacho
b037d4d628 wayland: Add touchpad gestures protocol 2015-08-12 23:20:25 +02:00
Carlos Garnacho
5092febaf8 gdk: Proxy touchpad events through the client-side window hierarchy
This includes poking the deepmost window, checking for the
GDK_TOUCHPAD_GESTURE_MASK bit set, and translating coordinates in events
accordingly.
2015-08-12 23:20:24 +02:00
Carlos Garnacho
8c2b3930da gdk: Add GDK_TOUCHPAD_GESTURE_MASK to GdkEventMask
Users will need to manually select on this in order to receive gesture
events.
2015-08-12 23:20:24 +02:00
Carlos Garnacho
a3b402a949 gdk: Add touchpad gesture events and event types.
Each gesture type has its separate GdkEvent struct, and begin/update/
end/cancel event types.

There is support for multi-finger swipe (3-4 fingers), and 2-finger
rotate/pinch gestures.
2015-08-12 23:20:24 +02:00
Christoph Reiter
6eaf5bd0f2 quartz: Implement CSD drag resize for all edges/corners
Manual resizing for CSD windows only worked with the bottom
right corner. This extends it to work for all corners and edges.

https://bugzilla.gnome.org/show_bug.cgi?id=753329
2015-08-08 13:28:35 +02:00
Jonas Ådahl
27763743b1 wayland: Don't assume drag context has a source window when finalizing
Only a drag context which was created with 'drag_begin' will be
guaranteed to have a source window at all times. Thus, in finalize we
cannot assume we can retrieve a GdkDisplay from the source_window
pointer since it may be NULL. Though, the display is only needed for
contexts created via 'drag_begin' thus we can retrieve it after
checking that is the case.

https://bugzilla.gnome.org/show_bug.cgi?id=749339
2015-08-05 10:31:55 +08:00
Rui Matos
bd3b496586 wayland: Ensure modal hint gets set on map
We need to be mapped to have a gtk_surface and thus be able to do
requests on it so we need to save the modal hint and apply it when we
get mapped so that code that sets the hint before showing a window
doesn't get ignored.

https://bugzilla.gnome.org/show_bug.cgi?id=753138
2015-08-03 14:24:38 +02:00
Rui Matos
36263076b2 wayland: Invalidate our gtk_surface when we're unmapped
Otherwise if we get mapped again we'll try to use an invalid
gtk_surface and the compositor will disconnect us.

https://bugzilla.gnome.org/show_bug.cgi?id=753138
2015-08-03 14:24:36 +02:00
Matthias Clasen
9f24b54786 Code cleanup
Use g_slist_free_full more consistently. This commit just converts
the obvious cases where g_slist_forall is directly followed by
g_slist_free.
2015-07-31 22:23:35 -04:00
Matthias Clasen
7d87eebfe7 wayland: Return a display name
Make gdk_screen_make_display_name() return a likely correct
name for the Wayland socket we are using.
2015-07-28 00:43:54 -04:00
Matthias Clasen
55edc81c10 x11: Make selection handling work across screens
When dealing with selection events, we might see windows from
other screens in the requestor field. The current x11 backend
code fails to wrap these in a foreign GdkWindow, since we
don't have the corresponding GdkScreen anymore. Work around
this by creating such 'foreign screens' on demand. We still
maintain the 1:1 relation between the display and the screen
returned by gdk_display_get_default_screen().

https://bugzilla.gnome.org/show_bug.cgi?id=721398
2015-07-27 23:20:53 -04:00
Christoph Reiter
2c329f5b3a quartz: disable system shadows if a GdkWindow shadow is set.
The shadow will be drawn in the wrong place in those cases so all we can
do is disable it. This fixes double shadows drawn around menus, popups
and tooltips.

https://bugzilla.gnome.org/show_bug.cgi?id=734984
2015-07-27 17:26:46 +02:00
Patrick Griffis
ee73e27fd7 quartz: Fix building
Broken by 6d04183c5d and 6ac07a2e85
2015-07-27 09:33:32 -04:00
Matthias Clasen
6d04183c5d quartz: Check if a drag ends inside a known window
If a drag ends inside a known window, set the dest_window field
in the drag context. This information is needed to implemented
notebook tab dragging.

https://bugzilla.gnome.org/show_bug.cgi?id=752638
2015-07-26 02:05:47 -04:00
Giovanni Campagna
83b7a0f0e5 wayland: Fix initial fullscreen monitor support
-1 means that we have no specific preference for an initial
fullscreen monitor, and -1 is less than the number of monitors,
so we would end up accessing invalid memory. Prevent that.

https://bugzilla.gnome.org/show_bug.cgi?id=752875
2015-07-26 01:55:56 -04:00
Matthias Clasen
b3fb1aefd8 win32: Support all css cursor names
Approximate some of the resize cursors with similar cursors.
2015-07-26 01:43:56 -04:00
Peter Wu
fffbe61c23 broadway: fix use-after-free on read errors
Call chain:
 - input_data_cb
   - broadway_server_read_all_input_nonblocking (input)
     - broadway_input_free (input)
       (now input is invalid)
     attempt to use input->active -> use-after-free

Make broadway_server_read_all_input_nonblocking return a boolean, TRUE
if the input was valid, FALSE otherwise. This allows input_data_cb to
detect whether the input was gone or not.

https://bugzilla.gnome.org/show_bug.cgi?id=741685
2015-07-26 00:46:13 -04:00
Jeremy Whiting
f9d903995d Added api to set a window to fullscreen on a given monitor.
https://bugzilla.gnome.org/show_bug.cgi?id=752677
2015-07-25 07:08:59 -06:00
Carlos Garnacho
76c1337675 GdkEvent: Turn out parameters optional
As pointed out by lazka in IRC, /me clearly out of phase after allow-none.
2015-07-24 14:42:34 +02:00
Carlos Garnacho
dc9e54887a GdkEvent: Fix introspection annotations on gdk_event_get(_root)_coords
These functions respect NULLs being passed, so the return values are
(nullable).
2015-07-24 13:44:22 +02:00
Pavel Grunt
44608dadc6 gdk-win32: Send fake release key event for shift key
Windows does not send any release key event for one of the shift keys
when both shift keys were pressed together. This commit solves
the problem by sending the extra release key event for the shift key
which was released as first, when the other shift key is released.

Other modifiers (e.g. Ctrl, Alt) do not have this problem.

https://bugzilla.gnome.org/show_bug.cgi?id=751721
2015-07-23 17:52:01 +02:00
Christoph Reiter
7ed5816829 quartz: remove maximized state when the window position/size is changed
So a window can be maximized/zoomed again after being moved away from
its maximized position. This makes the zoom button on non-CSD windows
work as before.
2015-07-23 13:20:05 +02:00
Christoph Reiter
eb37fd22e7 quartz: implement maximized/unmaximized
Instead of using the default zoom behaviour use the internal
maximized state for selecting our own zoom target. This makes
zooming work for CSD windows where for some reason the
given default zoom target is the current window frame itself
resulting in a shadowless window of the same size.

While this makes the zoom button behave a bit different as expected
it makes things more consistent with other platforms and fixes CSD
zooming.
2015-07-23 13:19:09 +02:00
Christoph Reiter
61ce90a8e2 quartz: make moving CSD windows right up to the screen's menu bar work.
The default implementation prevents the window + shadow to move above
the menu bar. Change it so only the window is considered.
2015-07-23 13:18:49 +02:00
Jonas Ådahl
2943bfef46 wayland: Always apply scaling factor to cursor hotspot and dimension
Prior to this patch, the hotspot would be passed in buffer coordinate
space. Where this were ever tested, i.e. in a patched mutter, the
server interpreted them incorrectly, which meant it went undiscovered.
In the updated mutter patches the incorrect behavior in GTK+ was
discovered due to the behavior in mutter was corrected.

In the themed cursor case, the dimensions were not correctly scaled
either, but this had no negative visible effect because the dimension is
only used for reporting damage tracking, and passing a bigger damage
region than surface has no negative visible effects.

https://bugzilla.gnome.org/show_bug.cgi?id=752616
2015-07-20 17:36:38 +08:00
Daniel Hams
e0f0197d0c GdkGLContext little fix to property names and descriptions.
https://bugzilla.gnome.org/show_bug.cgi?id=752502
2015-07-19 14:14:25 -04:00
Matthias Clasen
bb29c1fcc5 gdk: Add some parameter checking
This may help coverity recognize that we're not called with
invalid combinations.
2015-07-17 18:37:20 -04:00
Ignacio Casal Quinteiro
186c8f5254 gdk: fix crash if visual is NULL
cairo_xlib_surface_get_visual might return NULL so we need to
check for NULL before trying to use it.

https://bugzilla.gnome.org/show_bug.cgi?id=752520
2015-07-17 14:26:11 +02:00
Carlos Garnacho
72bfb40ccf Revert "x11: Query pointer devices' scroll valuators on toplevel enter events"
This reverts commit 77b8495bc4.

The commit broke more scenarios than fixed, better to go back to square one.
2015-07-15 21:19:25 +02:00
Owen W. Taylor
6504b2e534 GdkDisplayX11: Properly translate server timestamps from _NET_WM_FRAME_* messages
When using frame times from _NET_WM_FRAME_DRAWN and _NET_WM_FRAME_TIMINGS, we
were treating them as local monotonic times, but they are actually extended-precision
versions of the server time, and need to be translated to monotonic times in the
case where the X server and client aren't running on the same system.

This fixes rendering stalls when using X over a remote ssh connection.
https://bugzilla.gnome.org/show_bug.cgi?id=741800
2015-07-15 12:46:06 -04:00
William Hua
bd71b801de mir: don't ensure_surface if window not visible 2015-07-15 07:43:55 -04:00
William Hua
064f28fcbc mir: don't warn if transient_for is NULL 2015-07-15 07:43:55 -04:00
William Hua
b32899b98a mir: add more default settings under mir 2015-07-15 07:43:55 -04:00
Ryan Lortie
a00a5ed210 GtkApplication: avoid using stale timestamps
Avoid using a stale timestamp (from the last user interaction with the
application) when a message arrives from D-Bus requesting that a new
window be created.

In this case the most-correct thing that we can do is to use no
timestamp at all.

We modify gdk_x11_display_set_startup_notification_id() to allow a NULL
value to mean "reset everything" and then call this function
unconditionally on receipt of D-Bus activation requests.  The result
will be that a missing desktop-startup-id in the platform-data struct
will reset the timestamp.

Under their default configuration metacity and mutter will both map
windows presented with no timestamp in the foreground.  This could
result in false-positive, but there is very little we can do about that
without the original timestamp from the user event.

https://bugzilla.gnome.org/show_bug.cgi?id=752000
2015-07-14 18:34:09 -07:00
Matthias Clasen
bdf0820c50 Simplify Xft setting fallback
If we don't find Xft values in the X resource db, simply fall
back to the values that are hardcoded in /etc/X11/Xresources
anyway. Extra trickery with likely-made-up screen dimensions
is not going to yield better results, and only makes for a
deeper rabbit hole when debugging.
2015-07-07 20:54:16 -04:00
Tom Schoonjans
7d43cda493 gdkwindow-quartz: partial aspect ratio support
Support was added for GDK_HINT_ASPECT in
gdk_quartz_window_set_geometry_hints though with one restriction:
min_aspect and max_aspect have to be equal, which I believe corresponds
to the most common usage. A warning will be printed if this condition is
not met but min_aspect will be used anyway.
2015-07-07 09:36:29 -07:00
Michael Catanzaro
09273d91f3 wayland: print correct coordinates during DnD
Convert wl_fixed values to floats for printing, rather than printing
them as non-meaningful integers.

https://bugzilla.gnome.org/show_bug.cgi?id=752025
2015-07-06 11:32:26 -05:00
Jasper St. Pierre
abc47d7faa gdkdisplay-x11: The leader window should be an input-only window
This prevents it from creating a _NET_WM_USER_TIME_WINDOW, which can
confuse mutter / other window managers, and also me, when debugging.
2015-07-05 17:00:52 -07:00
William Hua
1e6c7e3af0 mir: fix mir pointer event to gdk translation 2015-07-03 13:48:13 -04:00