Commit Graph

1894 Commits

Author SHA1 Message Date
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
William Jon McCann
2d79334bb0 Deprecate and ignore gtk-can-change-accels
It is disabled by default
2013-06-26 12:00:42 -04:00
William Jon McCann
7e3a494fac Deprecate and ignore gtk-enable-mnemonics and gtk-auto-mnemonics" properties
They are both enabled by default.
2013-06-26 11:16:12 -04:00
William Jon McCann
e8147d15f7 Deprecate and ignore gtk-menu-images setting
GtkImageMenuItem images can still be enabled selectively by the app author
using the always-show-image property on the item.
2013-06-26 10:53:09 -04:00
William Jon McCann
65c31629c3 Deprecate and ignore gtk-button-images setting
Button images can still be enabled selectively by the app author
using the always-use-image property on the button.
2013-06-26 09:15:22 -04:00
John Lindgren
6eea6ddcc3 Optimize gdk_x11_screen_supports_net_wm_hint()
Move the call to gdk_x11_atom_to_xatom_for_display() outside of the
search loop in gdk_x11_screen_supports_net_wm_hint().  In my test case
(running Audacious for about a minute), this reduced the total number of
hash table lookups performed from 370,000 to 230,000.

https://bugzilla.gnome.org/show_bug.cgi?id=702913
2013-06-23 21:25:26 +02:00
Benjamin Otte
7ce198ea6f x11: Remove motif dnd leftovers 2013-06-13 15:31:35 +02:00
Matthias Clasen
6b63348037 Ignore Gtk/ShowInputMethodMenu and Gtk/ShowUnicodeMenu X settings
These are no longer used.
2013-06-07 18:14:20 -04:00
Matthias Clasen
cbe5a3a590 Add a tiled window state
This information is needed to draw client-side decorations
properly in this state.
https://bugzilla.gnome.org/show_bug.cgi?id=696001
2013-05-27 13:31:28 -04:00
Lionel Landwerlin
ea6ac66392 x11: make _gdk_device_query_state report the master's device state
Calling XIQueryPointer() on a slave device is going to trigger a
BadDevice X error. So in case we query a slave device state, ask the
master device instead.

https://bugzilla.gnome.org/show_bug.cgi?id=700233
2013-05-19 21:22:43 -04:00
Mario Sanchez Prada
201410de60 Missing NULL-check in XI2's implementation for get_window()
Add missing check in gdk_x11_device_manager_xi2_get_window(), returning
NULL if no valid XI2Event* has been found. Calling code seems to be
prepared to handle NULLs coming from this function, so it should be
safe enough (e.g. check gdk_event_source_get_filter_window()).

https://bugzilla.gnome.org/show_bug.cgi?id=700465
2013-05-19 21:21:41 -04:00
Alexander Larsson
8306d26714 GdkWindow: Track all native windows of native windows
We keep a list of all native children of a native window. This means
we don't have to recurse over the entire hierarchy to find any
native children.
2013-05-15 11:08:35 +02:00
Alexander Larsson
19560bf0d4 gdkwindow: Remove translate vfunc
This is not used anymore
2013-05-07 16:33:00 +02:00
Matthias Clasen
8af16c5d44 New visibility handling in gdk
Change the visibility handling to be the same way we do it in
GLib now. We pass -fvisibility=hidden to gcc and decorate public
functions with __attribute__((visibility("default"))).

This commit just does this for GDK, GTK+ will follow later.
2013-05-05 15:38:48 -04:00
Matthias Clasen
ca81028901 Add GDK_AVAILABLE_IN_ALL annotations in gdk
This is in preparation to modernizing our handing
of exported symbols.
2013-05-05 15:38:46 -04:00
Benjamin Otte
f7ee5450e1 displaymanager: Remove GInitable implementation
This is not needed anymore, as only one type exists and that type can
always be instantiated.
2013-05-02 16:17:30 +02:00
Benjamin Otte
0122a9da8e x11: Move initialization code
Move it from GdkDisplayManagerX11.init to GdkDisplay.class_init.

This shouldn't cause any problems, but who knows, so keep this patch
small.

Reason for this is the unification of display managers.
2013-05-01 18:11:26 +02:00
Benjamin Otte
a6a4428f23 gdk: Unvfuncify gdk_display_manager_open_display()
This looks like a pretty stupid patch, but it's only a step towards the
ultimate end goal: Get rid of all the displaymanagers.
2013-04-19 16:23:43 -04:00
Benjamin Otte
dd0fec4757 x11: Simplify function
Displays get made default displays automatically, so there's no need to
do it in the vfunc.
2013-04-19 16:18:25 -04:00
Benjamin Otte
f345051d36 displaymanager: Emit display-opened directly
Instead of letting every backend do it manually.
2013-04-19 16:18:25 -04:00
Benjamin Otte
0990c11a83 gdk: Unvfuncify generic key functions
This makes Wayland and X11 no longer call into XKB and libX11 for these
functions but use GDK's own copy of these functions, just like the
win32, quartz and broadway backends.
2013-04-16 15:30:14 +02:00
Benjamin Otte
c2793d9c1d docs: Move property section docs to correct file 2013-04-16 15:30:14 +02:00
Benjamin Otte
aa9e974c86 gdk: Make atoms handled generically
This is another step towards making GdkDisplayManager backend-agnostic.

Most of the backends profit from this as their atom implementations
where generic anyway - x11 needed that to allow multiple X displays and
broadway, quartz and wayland don't have the concept of displays.

The X11 backend still did things, so I only #if 0'd some code but did
not actually update anything.
2013-04-15 15:43:27 +02:00
Benjamin Otte
7ef508ff4a displaymanager: Handle list of displays in base class
This moves the add/remove_display() functions from the subclasses to
GdkDisplay and GdkDisplayManager. It also gets rid of the list_displays
vfunc.
2013-04-15 15:43:26 +02:00
Benjamin Otte
f7c0b025b9 displaymanager: Move set_default_display vfunc
... to GdkDisplayClass.make_default. It's only implemented by X11
anyway.
2013-04-15 15:43:26 +02:00
Benjamin Otte
839f402191 displaymanager: Handle the default display
... instead of having every backend do it on their own.
2013-04-15 15:43:26 +02:00
Matthias Clasen
c60bfa40ad Precache more atoms
Add a few more entries to the list of precached atoms.
2013-04-13 19:48:38 -04:00
David King
b0121ed0a1 xi2: Improve pointer emulation debug reporting
Reporting "true" or "false" is nicer than the value of the flag.

https://bugzilla.gnome.org/show_bug.cgi?id=697795
2013-04-11 15:56:13 +01:00
Carlos Garnacho
cc7b3985b3 xi2: Reset scroll valuators on synthesized crossing events
On crossing events resulting from moving windows (eg. workspace switch),
deviceid equals sourceid, so make those reset scroll valuators on all
slave devices to avoid misleading jumps in scroll events

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=690275
2013-04-10 20:18:09 +02:00
Benjamin Otte
f8b017faa8 x11: Simplify code for single-screen case 2013-04-06 10:47:55 +02:00
Benjamin Otte
a6b29d73d7 gdkdisplay: Remove get_screen() and get_n_screens() vfuncs 2013-04-02 11:45:44 +02:00
Benjamin Otte
47a8c2f733 x11: Make display:screen relation 1:1
Only ever open the default screen.

If apps need support for multiple screens, they need to
gdk_display_open() them manually.
2013-04-01 14:20:46 +02:00
Matthias Clasen
cb4cf67a95 Remove an unused field in GdkWindowX11
The toplevel_window_type field was only ever set to -1, and
never used. The actual, used toplevel_window_type field lives
in GdkWindow.
2013-03-31 22:44:59 -04:00
Matthias Clasen
bfcf9e471d Implement GInitable in GdkX11DisplayManager
Add GInitable implementation and fail the initialisation if it is not
possible to connect to the display server.
2013-03-23 00:48:25 -04:00
Matthias Clasen
0cc688aa92 Drop the Motif DND protocol
The implementation is not working and unused, since XDND is the
de-facto standard under X nowadays.

https://bugzilla.gnome.org/show_bug.cgi?id=695476
2013-03-12 20:03:19 -04:00
Ross Lagerwall
942c63d82b x11: Remove unused macro
https://bugzilla.gnome.org/show_bug.cgi?id=694395
2013-03-04 21:09:06 -05:00
Geoff Reedy
c6eddaafed GdkScreen: get a long X property correctly
https://bugzilla.gnome.org/show_bug.cgi?id=691426
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
2013-02-26 17:58:21 -06:00
Matthias Clasen
6fd897bb10 Add available marker to gdk_x11_window_set_utf8_property 2013-02-25 10:54:33 +01:00
Benjamin Otte
de08716526 x11: Handle case where xsettings are NULL 2013-02-19 19:55:02 +01:00
Benjamin Otte
588513fc9a x11: Get rid of XSettingsClient object
Instead, store its variables in the GdkX11Screen.
2013-02-19 14:33:39 +01:00
Benjamin Otte
3eef3290ad x11: Use _gdk_x11_get_xatom_for_display_printf()
instead of keeping the atom around all the time
2013-02-19 14:33:39 +01:00
Benjamin Otte
13eeb6ca33 x11: Introduce _gdk_x11_get_xatom_for_display_printf()
and use it instead of caching the atom in the GdkScreenX11.
2013-02-19 14:33:39 +01:00
Benjamin Otte
b2043511ee x11: Don't keep an "in_init" variable
Instead, track the init state with a boolean argument.
2013-02-19 14:33:39 +01:00
Benjamin Otte
200d6fe664 x11: Clean up xsettings header
- Don't use defines for renames
- Move enum into only source file using it
2013-02-19 14:33:38 +01:00
Benjamin Otte
e1efe3269c x11: Get rid of XSettingsSetting
Use GValue throughout instead.
2013-02-19 14:33:38 +01:00
Benjamin Otte
84679ba78b x11: Remove extra variable
Use a getter instead.
2013-02-19 14:33:38 +01:00
Benjamin Otte
78ce2563be x11: Split xsettings event filter into 2 functions
One for each type of window we watch.
2013-02-19 14:33:38 +01:00
Benjamin Otte
f6d6e932de x11: Make stored xsettings window a GdkWindow 2013-02-19 14:33:38 +01:00
Benjamin Otte
5507954e04 x11: Split function into two
Instead of a boolean is_start, have a start and an end function.
2013-02-19 14:33:38 +01:00
Benjamin Otte
8028a5b24a x11: Use gdk_display_flush() 2013-02-19 14:33:38 +01:00
Benjamin Otte
c91843edea x11: Get selection atom useing GDK functions
Don't call XInternAtoms ourselves.
2013-02-19 14:33:38 +01:00
Benjamin Otte
8596142336 x11: Warning improvements to xsettings code
... and using g_warning() instead of fprintf()
2013-02-19 14:33:37 +01:00
Benjamin Otte
01be4ce166 x11: Use usual Atom handling in xsettings code 2013-02-19 14:33:37 +01:00
Benjamin Otte
ed38dbe28f x11: Consolidate root window event setting in one place
No need to duplicate things in xsettings code.
2013-02-19 14:33:37 +01:00
Benjamin Otte
9ed7e883f2 x11: Remove unused argument 2013-02-19 14:33:37 +01:00
Benjamin Otte
edf19ab7b4 x11: Store GDK name in xsettings hash table
The X name is only used while reading the property, so no need to keep
it.
2013-02-19 14:33:37 +01:00
Benjamin Otte
afa3d611d6 x11: Remove XSettingsAction type
Use GdkSettingAction instead.
2013-02-19 14:33:37 +01:00
Benjamin Otte
a4f11fa4f5 x11: Make xsettings callbacks code go away
It's the same callbacks every time, so just move them into the source
file.
2013-02-19 14:33:37 +01:00
Benjamin Otte
c3607fd551 x11: Don't store name in XSettingsSetting anymore
This is in preparation to switching XSettingsSetting to GValue
2013-02-19 14:33:36 +01:00
Benjamin Otte
30a4150c8e x11: Use boolean instead of enum for errors in xsettings code 2013-02-19 14:33:36 +01:00
Benjamin Otte
23b039c8cd x11: Move error reporting to where the error happens
Also, use g_warning() instead of fprintf().
2013-02-19 14:33:36 +01:00
Benjamin Otte
b36b89151e x11: Move length checking into return_if_fail() macro 2013-02-19 14:33:36 +01:00
Benjamin Otte
e3206b9de4 x11: Use GDK error trapping code 2013-02-19 14:33:36 +01:00
Benjamin Otte
c84e303fb5 x11: Split out xsettings string reading code 2013-02-19 14:33:36 +01:00
Benjamin Otte
2b83062fc6 x11: Clean up xsettings header
Move private struct definitions into source file, remove unneeded C++
guards.
2013-02-19 14:33:36 +01:00
Benjamin Otte
0c58cb744c x11: Add debugging output for xsettings code 2013-02-19 14:33:36 +01:00
Benjamin Otte
08a6f554c3 x11: Use glib malloc funcs for XSettings 2013-02-19 14:32:41 +01:00