Commit Graph

1860 Commits

Author SHA1 Message Date
Carlos Garnacho
a53a931755 x11: Unset GdkX11DeviceXI2 scroll valuators on device change
Scroll valuators were being just appended again and again, leading
to 1) a growing memory issue anytime a device changed 2) the first
scroll valuators to stay permanent on the application lifetime, as
the first stored valuators would always match.

https://bugzilla.gnome.org/show_bug.cgi?id=705203
2013-11-22 12:49:32 +01:00
Carlos Garnacho
fee754e0d2 gdk: Ignore crossings generated by passive grabs when resetting scroll axes
Passive grabs may take pointer focus out of the application, even though
the pointer didn't leave the window, but those events still trigger resetting
of the scroll axes. This is most visible with compiz, and possibly other
reparenting WMs, where passive grabs happen on the WM-managed window that
is a parent of the application toplevel.

As it is not possible to have scrolling happening on the timespan a passive
grab takes action, it is entirely safe for GTK+ to assume none happened if
it gets a crossing event of that nature.

https://bugzilla.gnome.org/show_bug.cgi?id=699574#c33
2013-11-18 22:12:18 +01:00
Carlos Garnacho
962415aeb7 x11: Add extra debug spew on XI2 crossing and button events
This information will be useful in case someone stumbles on a situation
similar to https://bugzilla.gnome.org/show_bug.cgi?id=699574, so we can
figure out where do the crossing events come from or go to easily.
2013-11-17 00:42:18 +01:00
Carlos Garnacho
4168c3cab9 gdk: be more selective resetting scroll events
It's been reported in several applications that scrolling feels jerky
since commit cc7b3985b3.

Investigation reported that the combination of passive 4-7 button grabs
on the toplevel and the presence of native subwindows might trigger
too often crossing events from the child window to the toplevel and
back as scroll "buttons" trigger the passive grab. Those crossing events
would reset the scroll valuators rendering scrolling from jerky on
touchpads (where there's intermediate smooth events between the emulated
button ones) to ineffective on regular mouse wheels (where the crossing
event would reset the valuators right before the single smooth scroll
event we get is delivered)

So, only reset scroll valuators when the pointer enters the toplevel
(we only care about this when the pointer is on the window after it's
been possibly scrolling somewhere else), and it doesn't come from an
inferior.

The situations where this happened varied though, the native subwindow
could be one created explicitly by the application, or created indirectly
through gdk_window_ensure_native(). The latter was mainly the case for
evolution (through gtk_selection_set_owner()) and any GtkScrolledWindow
under the oxygen-gtk3 theme (through gdk_window_set_composited())

https://bugzilla.gnome.org/show_bug.cgi?id=699574
2013-11-17 00:42:18 +01:00
Ryan Lortie
a90bb7de0e Add a GtkSetting for 'shell-shows-desktop'
Add a GtkSetting for whether the desktop shell is showing the desktop
folder icons.

This is on by default because most desktop shells do show the icons on
the desktop.  We already have a patch in gnome-settings-daemon to bind
this to the org.gnome.desktop.background show-desktop-icons GSettings
key which is off by default on GNOME.

https://bugzilla.gnome.org/show_bug.cgi?id=712302
2013-11-14 15:03:04 -05:00
Owen W. Taylor
f50a3af1b7 Handle recursion from motion event handlers
If a motion event handler (or other handler running from the flush-events
phase of the frame clock) recursed the main loop then flushing wouldn't
complete until after the recursed main loop returned, and various aspects
of the state would get out of sync.

To fix this, change flushing of the event queue to simply mark events as
ready to flush, and let normal event delivery handle the rest.

https://bugzilla.gnome.org/show_bug.cgi?id=705176
2013-11-11 23:17:14 -05:00
Matthias Clasen
c46aca463a Respect deprecated button images setting
I have been convinced that it is a bad idea to change the behaviour
at the same time as deprecating it, so go back to respecting the
Gtk/ButtonImages xsetting in buttons created with
gtk_button_new_from_stock() when it is set.

The setting as well as the function are still deprecated, and the
default value of the setting will remain FALSE.
2013-10-24 20:35:55 -04:00
Matthias Clasen
627a03683f Respect deprecated menu images setting
I have been convinced that it is a bad idea to change the behaviour
at the same time as deprecating it, so go back to respecting the
Gtk/MenuImages xsetting in GtkImageMenuItem when it is set.

The setting as well as the widget are still deprecated, and the
default value of the setting will remain FALSE.
2013-10-24 20:03:02 -04:00
Bastien Nocera
438cd857c4 all: Add names to timeouts
Add names to every timeout we setup, so it's easier to track their
usage, and debug possible misbehaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=710651
2013-10-23 13:31:18 +02:00
Jasper St. Pierre
809aab2c8e gdkwindow-x11: Don't set WM_TAKE_FOCUS if accept_focus is FALSE
Otherwise, we'll be in the "Globally Active" mode instead of the
"No Input" mode.

https://bugzilla.gnome.org/show_bug.cgi?id=710389
2013-10-21 13:43:14 -04:00
Lionel Landwerlin
e62a6dfdbc GdkWindowX11: Prevent non renderered window to be display by the compositor
When mapping a window for the first time, make sure the compositor
won't display it until we're done painting.

https://bugzilla.gnome.org/show_bug.cgi?id=702196
2013-09-26 22:16:53 +01:00
Matthias Clasen
ca40ad1b1a Documentation fixes 2013-09-17 01:13:03 -04:00
Carlos Garcia Campos
9dbc19ea17 gdkdisplay-x11: Do not pass a NULL source device to _gdk_display_device_grab_update
Pass the master device instead if the last slave is NULL. This is
unlikely to happen in most of the cases, but can happen when running
unit tests where there's no pointer interaction to update the last
slave.

https://bugzilla.gnome.org/show_bug.cgi?id=696756
2013-09-16 12:47:38 +02:00
Jasper St. Pierre
29dda194bb gdkwindow-x11: Multiply opaque region rects by the window scale
This fixes rendering issues under HiDPI
2013-09-04 14:45:54 -04:00
Jasper St. Pierre
f07d113098 gdkwindow-x11: Correct math for filling in the _NET_WM_OPAQUE_REGION property
This fixes incorrect rendering under mutter and other WMs that implement
_NET_WM_OPAQUE_REGION.
2013-08-31 13:21:09 -04:00
Jasper St. Pierre
08fbba4558 gdk: Add opaque region setters
https://bugzilla.gnome.org/show_bug.cgi?id=706922
2013-08-28 10:33:57 -04:00
Benjamin Otte
6318e5e5d1 x11: Fix compiler warning 2013-08-27 16:03:55 +02:00
Matthias Clasen
13f6552a7e x11: Add EWMH workspace handling api
Add a few functions that give access to the EWMH workspace
properties.
2013-08-24 00:51:56 -04:00
Alexander Larsson
78dae73a30 x11: Add gdk_x11_display_set_window_scale
This lets you force a specific window scale, this is needed
for mutter to be able to disable the scaling as it needs access
to unmangled X window/screen sizes. It can also be useful to
force a specific scale in e.g. tests.
2013-08-20 11:15:08 +02:00
Alexander Larsson
66f1deef40 Enforce a fixed scale of 1 if no cairo scale support
We used to just follow the default, which would pick up scale
changes from xsettings, but that is not right if we can't
actually support scales.
2013-08-20 10:29:45 +02:00
Matthias Clasen
f8412eca34 Revert "Deprecate and ignore the cursor blink settings"
This reverts commit b2e666bf8f.

We need to keep cursor blinking configurable for accessibility
reasons.

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

Conflicts:
	gdk/win32/gdkproperty-win32.c
	gdk/x11/gdksettings.c
	gtk/gtksettings.c
	gtk/gtktextview.c
2013-08-16 22:45:13 -04:00
Jasper St. Pierre
8818d8a19b gtkwindow: Export our custom frame extents
This allows CSD windows to be maximized, tiled, and constrained
properly.

https://bugzilla.gnome.org/show_bug.cgi?id=705765
2013-08-13 10:38:49 -04:00
Benjamin Otte
129fc6ea3a x11: Remove dead assignment 2013-08-13 16:25:27 +02:00
Alexander Larsson
b2113b7384 gdk: Add gdk_cursor_new_from_surface
We need this to be able to handle scaled cursor images.
We implement the new _from_pixbuf by converting to a surface and
assuming the scale was 1.
2013-08-07 13:34:10 +02:00
Alexander Larsson
71fe43543c gdk: Add gdk_cursor_get_surface()
We want a surface so we can properly represent the scale factor for it.
All backends are converted to use surfaces and we reimplement the
backwards compat code in the generic code.
2013-08-07 13:34:10 +02:00
Alexander Larsson
3a0b65c5b9 x11: send monitors-changed when screen scale changes 2013-08-03 16:53:46 +02:00
Alexander Larsson
9237da2e57 x11: Update root window scale when the screen scale changes 2013-08-03 16:53:46 +02:00
Jasper St. Pierre
55edb3e2b1 gdkkeys-x11: Remove workaround code for Sun Microsystems X server
Xsun is no longer shipped to customers, and Oracle/Sun's Xorg distribution
uses "Sun Microsystems" as the vendor name, so this hack is incorrect in
the more common recent cases.
2013-08-02 09:03:10 -04:00
Benjamin Otte
7f01641280 x11: Don't crash when NULL eometry hints are set
Fixes crashers in gnome-panel.
2013-07-31 03:03:09 +02:00
Matthias Clasen
77a20871ff X11: Fix the cut-off for too large windows
We can only handle 2^15-1 pixels, not 2^16-1.
Pointed out by Morten Welinder.

https://bugzilla.gnome.org/show_bug.cgi?id=698758
2013-07-29 20:51:39 -04:00
Owen W. Taylor
c7574bb6c8 Disable frame sync for GtkPlug
Plug windows weren't redrawing properly because the embedded
window was expecting to get messages for each frame from the
compositor, but the compositor doesn't know about embedded
windows. Simply disable frame sync for GtkPlug's GdkWindow -
extending XEMBED to handle frame sync isn't interesting
at this point.

A new API gdk_x11_window_set_frame_sync_enabled() is added
to allow this to be done.

https://bugzilla.gnome.org/show_bug.cgi?id=701613
2013-07-22 18:36:58 -04:00
William Jon McCann
57fc8763e9 Deprecate and ignore the timeout-initial and timeout-repeat settings 2013-07-11 17:08:15 -04:00
William Jon McCann
7b66956e63 Deprecate and hardcode default toolbar icon size setting
Toolbar icon size can still be changed on a per-widget basis as
needed by the application developer.
2013-07-08 15:02:28 -04:00
William Jon McCann
425e977bb6 Deprecate and hardcode default toolbar style setting
Toolbar style can still be changed on a per-widget basis as
needed by the application developer.
2013-07-08 15:02:28 -04:00
William Jon McCann
c9bfd12d2f Deprecate and hardcode the value of visible-focus setting
Just use the default value of AUTOMATIC and make it just work.
2013-07-08 15:01:33 -04:00
Alexander Larsson
e8b38fedbd gdk: Convert mouse position to doubles, add new getters
We've long had double precision mouse coordinates on wayland (e.g.
when rotating a window) but with the new scaling we even have it on
X (and, its also in Xinput2), so convert all the internal mouse/device
position getters to use doubles and add new accessors for the
public APIs that take doubles instead of ints.
2013-07-03 14:39:25 +02:00
Alexander Larsson
867ba1df27 x11: Don't follow dpi and scale from xsettings when GDK_SCALE set
If things are hardcoded in the environment, that wins.
2013-07-03 14:36:05 +02:00
Alexander Larsson
4b9c08f48d x11: Add Gdk/UnscaledDPI to override Xft/DPI
This lets use use a scaled Xft/DPI for old apps while not
blowing up the size of scaled windows. Only apps supporting
Gdk/WindowScaleFactor should supprt Gdk/UnscaledDPI.
2013-07-03 14:34:25 +02:00
Alexander Larsson
d89a98e31e x11: Support the Gdk/WindowScalingFactor xsetting
This xsetting can be used to tell Gtk to use a specific window
scaling for the screen.
2013-07-03 14:34:14 +02:00
Alexander Larsson
525e5cff04 x11: Initial cut at supporting window scaling for X11
If you set GDK_SCALE=2 in the environment then all windows will be
scaled by 2. Its not an ideal solution as it doesn't handle
multi-monitors at different scales, and only affects gtk apps.
But it is a good starting points and will help a lot on HiDPI
laptops.
2013-07-03 14:34:14 +02:00
William Jon McCann
85c0614707 Remove gtk-im-status-style and gtk-im-preedit-style from GDK as well 2013-06-30 13:45:43 -04:00
William Jon McCann
7ca327c9bb Deprecate the unused gtk-file-chooser-backend setting 2013-06-30 13:44:24 -04:00
Matthias Clasen
dfa2e91cd7 GdkScreenX11: Dispose visuals
If we let them hold onto their X resources until finalize,
it is too late.
2013-06-29 19:23:23 -04:00
Matthias Clasen
42e45f4f75 GdkVisualX11: Add a dispose implementation
We need to be able to drop X resources before finalization.
2013-06-29 19:22:51 -04:00
Matthias Clasen
459e10196d GdkDeviceManagerXI2: chain up in constructed
Dispose does chain up, and the parent class' dispose expects
that the object has been fully constructed.
2013-06-29 19:21:28 -04:00
William Jon McCann
e779e04bc2 Deprecate and ignore gtk-icon-sizes setting
We don't have icons rendered at arbitrary sizes and we have better
APIs that aren't restricted to GtkIconSizes.
2013-06-26 18:04:27 -04:00
William Jon McCann
3e96625411 Remove the rest of gtk-touchscreen-mode 2013-06-26 15:35:47 -04:00
William Jon McCann
b26c74e5da Deprecate and ignore gtk-menu-bar-accel setting
Use 'F10' by default.
2013-06-26 14:21:44 -04:00
William Jon McCann
aa78c888eb Deprecate and ignore gtk-fallback-icon-theme
The standard icon themes have built in fallbacks.
2013-06-26 12:47:43 -04:00
William Jon McCann
b2e666bf8f Deprecate and ignore the cursor blink settings
And hardcode them to reasonable values.
2013-06-26 12:32:31 -04:00