Commit Graph

7526 Commits

Author SHA1 Message Date
Philippe Normand
215c2be76f meson: Set the compatibility version correctly on macOS
And bump to Meson 0.48 as this feature requires it.
2019-04-11 16:45:36 +02:00
Philippe Normand
89d5c543ac meson: Build fixes for macOS 2019-04-11 16:45:36 +02:00
Nirbheek Chauhan
a4fe15d9f0 meson: Sync build files with master and update to 3.24 2019-04-11 16:45:27 +02:00
Nirbheek Chauhan
8ec004cc08 Import meson build files from an 3.22
Specifically, from 6dd6660c68
2019-04-11 16:40:33 +02:00
Jan Alexander Steffens (heftig)
2d3936cbe6
Centralize DESKTOP_STARTUP/AUTOSTART_ID handling
Add private API to GDK to move these variables from the environment into
static scope. Also move the DESKTOP_STARTUP_ID validation here to reduce
code duplication.

Use constructors to read them as early as possible; however, do not
unset them until first requested. This avoids breaking gnome-shell and
gnome-settings-daemon, which want to use the DESKTOP_AUTOSTART_ID in
their own gnome-session clients.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1761
2019-04-02 09:14:35 +02:00
Robert Mader
35c4627fac gdk/wayland: Properly calculate coordinates for show_window_menu()
The event received in `gdk_wayland_window_show_window_menu()` can
come from widgets with a GdkWindow. In those cases the coordinates
are relative to the widget, not the root window.
This results in a misplaced window menu.

Properly calculate the coordinates by iterating to the toplevel
window as suggested by Carlos Garnacho.

https://gitlab.gnome.org/GNOME/gtk/merge_requests/684
2019-04-01 11:11:12 +02:00
Christoph Reiter
09e0881a51 gdk/Makefile.am: dist gdkconstructor.h
The file was added in 05bc2f4dc1
2019-03-30 20:03:44 +01:00
Matthias Clasen
e20b7a3a8d Merge branch 'gir-gdkx11-missing-sources' into 'gtk-3-24'
build: Add missing sources for the GdkX11 gir build

See merge request GNOME/gtk!689
2019-03-30 12:28:59 +00:00
Christoph Reiter
15a7a93d10 build: Add missing sources for the GdkX11 gir build
Noticed while diffing .gir files with the meson port.
2019-03-30 11:57:50 +01:00
Christoph Reiter
8034ba4803 build: Include all generated sources for the gdk gir build
The main one is gdkversionmacros.h which resulted in
GDK_MAJOR_VERSION, GDK_MINOR_VERSION and GDK_MICRO_VERSION not being included
in the Gdk-3.0.gir.

Noticed while diffing girs with the meson port.
2019-03-30 11:14:33 +01:00
Philip Chimento
f264e0dbf9 quartz: Update GL context on window resize
The previous version of this patch sent an update message to the
NSOpenGLContext in a GdkGLContext::update vfunc, but that vfunc does not
exist any more.

See: #517
2019-03-29 11:25:29 +01:00
Brion Vibber
f34709807f quartz: implement GdkGLContext for Quartz backend
Current problems:
* other widgets in a GL-painted window are low-resolution on Retina
  display
* something wrong with paint updates; gdkgears demo only updates every
  couple of seconds but reports ~30fps

See: #517
2019-03-29 11:25:29 +01:00
Emmanuele Bassi
ecf3431d3f Merge branch 'gl3-shaders' into 'gtk-3-24'
Use GLSL 3.30 shaders

See merge request GNOME/gtk!671
2019-03-29 09:57:21 +00:00
Emmanuele Bassi
bfcd062e8e Use GLSL 3.30 shaders
We currently ask for anything above 3.2 GL contexts, but we're still
using GLSL 1.50 shaders all over the place. If a GL driver supports GL
3.2+ and GLSL 1.50 only then we'd be in trouble, but the chances of that
happening are really small.
2019-03-27 16:03:43 +00:00
LRN
cddd88064c Merge branch 'ime-load-fix' into 'gtk-3-24'
GDK W32: Test for IME correctly

See merge request GNOME/gtk!658
2019-03-22 15:00:56 +00:00
Руслан Ижбулатов
2e1a55118a GDK W32: Fix property setting to correctly use static strings
The strings that are set are static, so g_value_set_static_string() should
be used to set them instead of g_value_set_string().
2019-03-22 14:52:23 +00:00
Руслан Ижбулатов
3b244c9f11 GDK W32: Test for IME correctly
ImmIsIME() doesn't work (always returns TRUE) since Vista.
Use ITfActiveLanguageProfileNotifySink to detect TSF changes,
which are equal to IME changes for us.

Also make sure that IMMultiContext re-loads the IM when keyboard layout
changes, otherwise there's a subtle bug that could happen:
* Run GTK application with non-IME layout (US, for example)
* Focus on an editable widget (GtkEntry, for example)
* IM Context is initialized to use the simple IM
* Switch to an IME layout (such as Korean)
* Start typing
* Since IME module is not loaded yet, keypresses are handled
  by a default MS IME handler
* Once IME commits a character, GDK will get a WM_KEYDOWN,
  which will trigger a GdkKeyEvent, which will be handled by
  an event filter in IM Context, which will finally re-evaluate
  its status and load IME, and only after that GTK will get
  to handle IME by itself - but by that point input would
  already be broken.
To avoid this we can emit a dummy event (with Void keyval),
which will cause IM Context to load the appropriate module
immediately.
2019-03-22 14:52:18 +00:00
John Ralls
024cb267dd [GdkQuartz] Fix two build issues
1. NSRect and CGRect aren't toll-free bridged in 32 bit builds.
2. NSWindowCollectionBehavior(Dis)AllowTiling is defined beginning in 10.11.
2019-03-21 16:01:51 -07:00
John Ralls
5c039a1aa0 [GdkQuartz] Set the toplevel for the pointer if it's NULL.
Gdk sometimes misses crossing events on popups, so the cached toplevel
may be NULL. If it is, find the toplevel under the pointer and set it.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/623
2019-03-18 13:01:11 -07:00
Carlos Garnacho
ed9a6f755d gdk/wayland: Preserve stored startup id for gtk_surface1.request_focus
The use of the startup ID is now twofold, we reply back with it to end any
corresponding startup notification, but we also use it on
gtk_surface1.request_focus to acknowledge that the activation might raise
the corresponding window.

We should preserve the startup ID for the second to work properly, so avoid
clearing it here. It is inconsequential if the underlying
gtk_shell1.set_startup_id request happens multiple times on no longer existing
startup IDs, so don't bother preventing that from happening.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1754
2019-03-18 12:28:57 +01:00
Matthias Clasen
967c5f7f7f Merge branch 'wip/carlosg/include-constructors-header-3-24' into 'gtk-3-24'
gdk: Include copy of glib/gconstructor.h

See merge request GNOME/gtk!643
2019-03-18 01:09:40 +00:00
Carlos Garnacho
05bc2f4dc1 gdk: Include copy of glib/gconstructor.h
This is named gdkconstructor.h to avoid any possible conflicts. This fixes
the current usages of G_HAS_CONSTRUCTORS, as that header is not installed
by glib.
2019-03-17 21:50:35 +01:00
John Ralls
3a959e984f Force a window resize if the content view frame changes.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1029

Should fix most if not all other cases where system-caused changes to
the NSWindow result in the Gdk coordinates not mapping correctly to the
AppKit coordinates.
2019-03-17 10:15:30 -07:00
John Ralls
0f5603e74f Use n_displays for all monitor counts. 2019-03-11 16:52:07 -07:00
John Ralls
0524362721 Reverse signs on gdk <-> ns x coordinate transforms.
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1711
2019-03-11 16:28:23 -07:00
John Ralls
261f1dc395 Switch quartz monitors collection from hash table to ptr array.
It's easier to find in a ptr array than to iterate over a hash table.
2019-03-11 16:28:19 -07:00
John Ralls
3bd9a3453f Change computation of coordinates.
Transform GdkQuartzMonitor geometry to Gdk coordinate system.
Move computation of Display geometry from GdkQuartzScreen to
GdkQuartzDisplay and use AppKit coordinates.

Closes https://gitlab.gnome.org/GNOME/gtk/issues/1593
2019-03-11 16:26:50 -07:00
John Ralls
28848176e5 Don't scan the seat's slave list for keyboards.
There aren't any, just the master_keyboard which one accesses with
gdk_seat_get_keyboard().
2019-03-11 16:16:47 -07:00
John Ralls
9a0e40b6da Restore switching keyWindow when changing windows.
Inadvertently removed when converting from gdkdevicemanager to gdkseat.
2019-03-11 16:16:46 -07:00
John Ralls
db84dc8e58 Fix crash when closing a fullscreen window. 2019-03-11 16:16:46 -07:00
John Ralls
c91ca69c2c Merge branch 'aux-window' into gtk-3-24 2019-03-03 20:27:41 -08:00
John Ralls
03c5b92da2 [quartz] Full-screen only "normal" windows and splashscreens.
So dialogs, pop-ups, etc. behave as expected when parent is in
full-screen.

Tiling is allowed for normal windows and splash screens and disallowed
for others.
Closes https://gitlab.gnome.org/GNOME/gtk/issues/1627
2019-03-03 20:05:13 -08:00
Bastien Nocera
e5b83f1a87 window: Advise using gtk_window_present_with_time()
Rather than gtk_window_present()
2019-02-22 18:38:13 -05:00
John Ralls
512da66761 Silence incompatible type warning. 2019-02-19 11:08:02 -08:00
John Ralls
f3b1704a99 Remove unnecessary casts and silence may-not-return-value warning.
NSPoint and NSRect are typedefs of CGPoint and CGRect so the casts
were unnecessary and confused llvm when compiling 32-bit.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1640
2019-02-19 11:08:02 -08:00
John Ralls
6afd174162 Merge branch 'suyuan/fix-macos-accented-char-input' into gtk-3-24. 2019-02-17 13:04:20 -08:00
Mickael Istria
9b394d8753 Issue #1633 - Ensure focus on click
This is necessary to give back focus to the Broadway elements when
content is embedded in an IFrame.

Signed-off-by: Mickael Istria <mistria@redhat.com>
2019-02-05 14:13:22 +01:00
Matthias Clasen
3da6497d9f gdk: Stop using deprecated pango api 2019-01-31 14:07:28 -05:00
Matthias Clasen
998314b8ba gdk: Add a copy of pango_unichar_direction
This api has been deprecated in pango.
2019-01-31 14:07:28 -05:00
Christian Hergert
99d013994b quartz: release linked list as we process it
Rather than performing the list iteration and the list free as separate
steps, free the list link while iterating.
2019-01-31 17:55:19 +01:00
Suyuan Chang
cfad43b80d macOS: Fix bug that entry cannot press and hold a key to input accented character.
There're two issues in GdkQuartzView's NSTextInputClient implementation
causes this bug.

1. The -(NSRange)selectedRange should not return [NSNotFound, 0] if
   there's no selection. The accented character window will not show
   if returned NSRange's location is NSNotFound. Instead of that, the
   NSRange's location should be the caret position in the text input
   buffer.

2. The accented character window will invoke
   -(void)insertText:replacementRange: with non-empty replacement
   range, to replace non-accented character with accented character
   after user select it from accented character window. This case is
   not implemented in original code. Here I use another gobject data
   to pass the information to input module and convert it into
   'delete-surrounding' event.

Besides these, there's another bug cause gtk_im_context_filter_keypress()
return wrong value while user press and hold a key. When user press
and hold a key, the accented character window will consume the
repeating key down event. Is this case, gtk_im_context_filter_keypress()
should return TRUE, indicate the key press is filtered by input
method module. But it will return FALSE because
gtk_im_context_filter_keypress() assume that every key press event
will generate some text from input method module.

Fixes #1618
2019-01-30 22:07:23 -08:00
Christoph Reiter
a0129f556b Merge branch 'get-timings-transfer-3' into 'gtk-3-24'
g-i: Add transfer none annotations for frame clock timings getters

See merge request GNOME/gtk!512
2019-01-29 10:36:19 +00:00
Carlos Garnacho
bff46d8696 gdk/wayland: Set a startup notification
And notify the shell about it. This is done through the
gtk_shell1.notify_launch request added in gtk-shell v3. All the plumbing
on the way to the activated application is already in place to transfer
the startup ID, so the other side just has to reply with
gtk_surface1.request_focus.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/624
2019-01-23 19:13:37 +01:00
Carlos Garnacho
ed9db5a173 gdk/wayland: Implement gdk_window_present()
This uses the gtk_surface1.request_focus request added in gtk-shell v3,
the given startup ID may be used by the compositor in order to determine
when was the request started, and whether user input happened in between.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/624
2019-01-23 19:13:37 +01:00
Carlos Garnacho
45d6c0091a wayland/protocol: Update gtk-shell protocol to v3
This version has 2 new requests:
- gtk_shell1.notify_launch notifies the compositor that the requesting
  client shall launch another application. The given ID is expected to
  be unique.
- gtk_surface1.request_focus notifies the compositor that a surface
  requests focus due to it being activated. The given ID is passed to
  this process through undetermined means, if it corresponds with a
  current startup ID and there was no user interaction in between the
  surface will be focused, otherwise it will demand attention.
2019-01-23 19:13:37 +01:00
Matthias Clasen
e2d9563a55 Merge branch 'wip/long-combo-boxes' into 'gtk-3-24'
Fix long combo box positioning

See merge request GNOME/gtk!514
2019-01-18 22:42:04 +00:00
Chun-wei Fan
5ffbeeff91 MSVC builds: Improve introspection build process
To avoid confusion, have the NMake Makefiles output the built introspection
files in the same location where the binaries are built for the project
files, according to the Visual Studio version, platform and configuration
where the build is carried out.

Also make generating the introspection NMake snippet portion more robust to
source additions and removals by checking on Makefile changes too.
2019-01-18 16:25:49 +08:00
Jonas Ådahl
66ee4dea40 wayland/window: Don't remap when handling xdg_popu.configure
If the size was constrained by the xdg_positioner mechanisms, we handle
the resize by resizing the popup window. What we shouldn't do is
hide/show the popup window so avoid that.
2019-01-17 16:17:32 +01:00
Tomasz Miąsko
ea286fe8f9 g-i: Add transfer none annotations for frame clock timings getters 2019-01-17 10:13:29 +01:00
Emmanuele Bassi
32b21ee905 Merge branch 'gtk-3-24' into 'gtk-3-24'
Revert "gdk: deactivate/activate surface on keyboard grabs"

See merge request GNOME/gtk!484
2019-01-09 16:31:32 +00:00
Jonas Ådahl
a907552df9 wayland/cursor: Make sure the cached cursor has the right size
The cache key is just the name of the cursor, so if a previously added
cursor had e.g. scale == 1, if we ask for a new cursor with scale == 2,
we might still fetch the scale == 1 cursor from the cache. Avoid this by
making sure the scale of the cached one is correct.

If it isn't, load the cursor as normal, and update the cache entry with
the new properly scaled cursor.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/1183
2019-01-08 18:48:16 +01:00
Jonas Ådahl
d31107c4fe wayland/cursor: Rename GdkWaylandCursor variable
It was called "private" for some reason. Call it "wayland_cursor"
instead, as it's a GdkWaylandCursor, and also not private.
2019-01-08 18:48:16 +01:00
John Ralls
70b7b89411 [Quartz]Check mode before setting the monitor scale factor.
CGDisplayModeGetWidth returns 0 if mode is NULL; that happens if the
CGDisplay is offline or mirroring another monitor and it leads to a
divide-by-zero crash.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1565
2019-01-05 20:06:50 -08:00
Samuel Thibault
e84016cd17 Revert "gdk: deactivate/activate surface on keyboard grabs"
This reverts commits f23bfc6b69. and
c926b28d96.

This reintroduces #85, but see discussion in
https://gitlab.gnome.org/GNOME/gtk/merge_requests/433 for the unforeseen
invasive consequences of these commits.
2019-01-04 17:07:18 +01:00
Matthias Clasen
3a1c5f7232 Wayland: Support key theme setting
GTK+ 3 has supported this all along, so we should support
it for Wayland as well, for feature parity.

Closes: #1553
2019-01-04 10:18:51 -05:00
Matthias Clasen
5662f2e34f Fix XChangeProperty calls
They must be long...

Closes: #1556
2019-01-02 19:32:00 -05:00
Tomasz Miąsko
d3b6d16d85 Annotate values of PRIORITY constants
g-ir-scanner incorrectly evaluates macro definition that include
references to other macro definitions. Provide a correct value as an
annotation.

Differences in generated gir files:

```diff
@@ -19017 +19017 @@
-    <constant name="PRIORITY_REDRAW" value="20" c:type="GDK_PRIORITY_REDRAW">
+    <constant name="PRIORITY_REDRAW" value="120" c:type="GDK_PRIORITY_REDRAW">
@@ -74229,3 +74229,3 @@
     </constant>
-    <constant name="PRIORITY_RESIZE" value="10" c:type="GTK_PRIORITY_RESIZE">
+    <constant name="PRIORITY_RESIZE" value="110" c:type="GTK_PRIORITY_RESIZE">
       <doc xml:space="preserve">Use this priority for functionality related to size allocation.
@@ -106786,3 +106786,3 @@
     <constant name="TEXT_VIEW_PRIORITY_VALIDATE"
-              value="5"
+              value="125"
               c:type="GTK_TEXT_VIEW_PRIORITY_VALIDATE">
```
2018-12-22 13:17:58 +01:00
Carlos Garnacho
33faf46516 Merge branch 'wip/wacom-tool-type-from-property-3.24' into 'gtk-3-24'
Wacom tool type fixes

See merge request GNOME/gtk!453
2018-12-18 20:09:40 +00:00
John Ralls
1c1a86d0fc Merge Ignacio Casal Quintero's quartz-scale-factor' into gtk-3-24. 2018-12-18 10:55:35 -08:00
Ignacio Casal Quinteiro
1a9377bab9 quartz/display: add back scaling factor
With the last patches one thing that got lost if the scaling
factor. This is very visible when i.e loading a svg image
in a Retina display.
2018-12-18 18:08:47 +01:00
John Ralls
e105fefc49 Fix copy-paste error. 2018-12-18 09:07:15 -08:00
Peter Hutterer
7b33369bfb x11: make the tool lookup dependent on the hw id as well
Tools on the same physical item have the same serial number, so the eraser
and the pen part of a single pen share that serial number. With the current
lookup code, we'll always return whichever tool comes first into proximity.

Change the code to use the hw id in addition to the serial number, this way we
can differ between two tools.
2018-12-18 10:48:03 +10:00
Peter Hutterer
c6dd92294d x11: don't add unknown tools to our list
Generic tools (Bamboo, built-in tablets) always have the same serial number
assigned by the wacom driver. This includes the touch tool when the wacom
driver handles the touch evdev node (common where users require the wacom
gestures to work).

When the first device is the touch device, a tool is created with that serial.
All future tools now return the touch tool on lookup since they all share the
same serial number. Worse, this happens *across* devices, so the pen
event node gets assigned the touch tool because they all have the same serial.

Since we don't actually care about the touch as a tool, let's skip any unknown
tool. This captures pads as well.
2018-12-18 10:48:02 +10:00
Peter Hutterer
f173d1bc5c x11: get the tool type from the wacom driver properties
Any wacom device currently sets the tool type to UNKNOWN. The wacom driver has
a property that exports the tool type as one of stylus, eraser, cursor, pad or
touch. Only three of those are useful here but that's better than having all
of them as unknown.
2018-12-18 10:47:26 +10:00
Daniel Boles
3986326bbf RGBA: tiny grammar improvements in to_string doc 2018-12-17 20:16:42 +00:00
Daniel Boles
be60ddbec9 RGBA: Consistently use “” around inline arg names
instead of being inconsistent and not using them later, which leaves a
bunch of single letters floating among real words, not the prettiest.
2018-12-17 20:16:42 +00:00
Daniel Boles
33a966952a RGBA: Fix example to_string output for reality/CSS
* We don't output spaces anywhere in the code, unlike the doc suggested.
* CSS explicitly forbids whitespace between function names and lparens:
  https://stackoverflow.com/questions/13877198
2018-12-17 20:16:42 +00:00
Chun-wei Fan
013b9cbc1f gdkevents-win32.c: Fix GDK_SETTING event notification on IME change
We need to call g_strdup() on the name that we pass in for notifying the
GDK_SETTING event so that when we do gdk_event_free() later we will not
get a crash (stack corruption) that results from attempting to g_free()
something that is not dynamically allocated.
2018-12-17 12:43:24 +08:00
John Ralls
aeec73f53f Refine GdkQuartzNSWindow convertPointToScreen:
and convertPointFromScreen:, making them handle all MacOS versions
so that all of the if-deffing happens in the function definitions.
This happens to fix issue 1518 because it turns out that contrary
to the annotation in the 10.14 nNSWindow.h, convertPointToScreen and
convertPointFromScreen originate in 10.14, not 10.12.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1518
2018-12-15 16:28:44 -08:00
John Ralls
baa283b73b Don't make initializing return_val conditional.
Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1517
2018-12-15 16:28:44 -08:00
Daniel Boles
e3a1593a09 x11: Fix deprecation macro use
G_GNUC_END_IGNORE_DEPRECATIONS terminates the if statement and does not
consider the following block to be part of the if. So that block was
always taken irregardless of the pattern.

Fixes #1280
2018-12-13 17:22:22 +01:00
Benjamin Otte
6a47e9a8b9 x11: Be a lot more careful about setting ParentRelative
We don't want to set ParentRelative when:

- the parent window is NULL
  In that case we are unsure about the depth, so better err on the side
  of caution and avoid a BadMatch by accepting ugly output.
- the cairo pattern is in an error status
  This should never happen - unless you start up in OOM - but better
  be safe than sorry.

Might help with the spurious crashes in #1280.
2018-12-13 05:28:54 +01:00
Szunti
4c8fcd6a6f Add gdk_x11_display_get_parent_relative_pattern().
Fixes #1280, tray icons not drawing background. This is a magic pattern only
usable for gdk_window_set_background_pattern() that sets the underlying
X window's background to ParentRelative.
2018-12-12 02:56:35 +01:00
Chun-wei Fan
15935bb248 Merge branch 'win10-use-system-font' into 'gtk-3-24'
GDK W32: Always set gtk-font-name to the active UI font. Fixes #1484

See merge request GNOME/gtk!436
2018-12-10 06:20:34 +00:00
John Ralls
833ddc6e8d Silence enum type warning in 10.9. 2018-12-07 16:59:46 -08:00
John Ralls
9e212cd981 Prevent crash if display->touch_implicit_grabs is NULL. 2018-12-07 16:59:45 -08:00
John Ralls
5294c4f6f3 Fix crash if there are no grabs in place. 2018-12-07 16:59:45 -08:00
John Ralls
e786da9ca9 Complete GdkQuartzDisplay Implementation.
Changing FIXME on unneeded functions to X11-only where appropriate.
2018-12-07 16:59:45 -08:00
John Ralls
89c8c55fda Remove 2 unused functions. 2018-12-07 16:59:45 -08:00
John Ralls
eb2799cd7a Make _gdk_quartz_window_flush a no-op for MacOS 10.14 and later.
According to Apple's docs it's no longer necessary as Cocoa will notice
any changes and call drawRect as needed.
2018-12-07 16:59:45 -08:00
John Ralls
1165ab9d27 Replace deprecated gestalt for 10.10 and later.
It was deprecated in 10.8 but no replacement until 10.10.
2018-12-07 16:59:44 -08:00
John Ralls
ca6db9a79d Add compile-time check for NSGraphicsContext graphicsPort/CGContext.
Runtime check alone doesn't silence warning.
2018-12-07 16:59:44 -08:00
John Ralls
f30ed5ddc7 Fix Cocoa style and event constants for MacOS X 10.12 and later. 2018-12-07 16:59:44 -08:00
John Ralls
941f3c3887 Move the CGDisplayReconfigurationCallback to gdkdisplay-quartz.c.
Handling more flags, handling them correctly, and emitting the requisite
signals.

Change screen layout to use CGGetActiveDisplayList instead of NSScreens,
eliminating the latency between updating screens and recomputing the
root window.
2018-12-07 16:39:13 -08:00
John Ralls
9773b1951c Clean up some unused variables. 2018-12-07 16:39:13 -08:00
John Ralls
85f52dceaa Replace NSInputManager for MacOS 10.6 and later. 2018-12-07 16:39:13 -08:00
John Ralls
08b871fa51 Replace the deprecated GdkDisplayManager with GdkSeat. 2018-12-07 16:39:13 -08:00
John Ralls
28b8bbda45 Implement the GdkMonitor/GdkDisplay API.
Moving the initialization of the GdkQuartzMonitors to GdkQuartzDisplay from
the now-obsolete GdkQuartzScreen. Use QuartzDisplayServices for
monitor enumeration and to populate the GdkMonitor properties. This is
better aligned with acting on the Quartz Services callbacks for monitor
changes and with Cairo which also uses CoreGraphics for drawing.
2018-12-07 16:39:13 -08:00
John Ralls
4d0cae4468 Replace convertBaseToScreen & convertScreenToBase.
With convertPointToScreen & convertPointFromScreen when
MacOS version is > =10.7, when the earlier functions were
deprecated and replaced.
2018-12-07 16:39:12 -08:00
John Ralls
74aecac6fe Remove commented-out code copied from X11 implementation. 2018-12-07 16:24:58 -08:00
John Ralls
2b1c3fba96 Reorder virtual method assignments and fill in missing ones.
Makes auditing easier.
2018-12-07 16:24:58 -08:00
Christoph Reiter
9e7cc89f4a GDK W32: Always set gtk-font-name to the active UI font. Fixes #1484
This makes apps use "Segoe UI 9" by default instead of whatever matches "Sans 10".
It also cleans up the code and uses some new pango API while at it.

This was previously disabled in 9e686d1fb5 because it led to a poor glyph coverage
on certain versions of Windows which don't default to "Segoe UI 9" (Chinese, Korean, ..)
because the font fallback list was missing in pango.

This is about to get fixed in https://gitlab.gnome.org/GNOME/pango/merge_requests/34
so enable it again when we detect a new enough pango version.
2018-12-07 09:32:14 +01:00
Christoph Reiter
5a23c0f038 GDK W32: set default settings for fontconfig
Enables hinting, antialiasing and set the subpixel orientation according to the
active clear type setting. This ensures that font rendering with the fontconfig backend
looks similar to the win32 backend, at least with the default system font.
2018-12-01 10:43:53 +01:00
Christoph Reiter
83204dd882 win32: Don't multiply the scroll event deltas by the Windows scroll lines setting. See #1408
GTK widgets expect the scroll deltas to be 1 or -1 and calculate a scroll value from that.
Multiplying the delta by the Windows scroll line setting (which defaults to 3) results
in a much larger delta and vastly different behaviour for running a GTK app on Windows
vs on Linux. For example text view and tree view scroll by 9 lines per scroll wheel tick
per default this way while on Linux it is around 3.

Remove the multiplication for now.
2018-11-24 10:24:27 +01:00
Timm Bäder
0040b256fe Merge branch 'gdk-cursor-new-deprecated-for' into 'gtk-3-24'
gdk: Add deprecated for macro for gdk_cursor_new

See merge request GNOME/gtk!416
2018-11-19 08:04:48 +00:00
Christoph Reiter
31b810abca g-i: Add some nullable annotations
Based on grepping arg docs for NULL.
See https://gitlab.gnome.org/GNOME/pygobject/issues/261
2018-11-18 13:40:24 +01:00
Robert Ancell
dea9525f68 gdk: Add deprecated for macro for gdk_cursor_new 2018-11-17 21:23:40 +13:00
John Ralls
bb376222c1 Reset the Quartz resolution to 72.0 dpi.
Further feedback on https://bugzilla.gnome.org/show_bug.cgi?id=787867
indicates that 96.0 dpi scales fonts 4/3 larger than native applications.
2018-11-14 09:02:45 +09:00
Matthias Clasen
d21832719b wayland: Adapt to settings portal api change
ReadAll now accepts an array of patterns.
2018-11-12 14:10:13 -05:00
Timm Bäder
f972ab8818 Merge branch 'plug_race' into 'gtk-3-24'
Fix race in GtkPlug window creation

See merge request GNOME/gtk!387
2018-11-08 04:49:25 +00:00