Commit Graph

49961 Commits

Author SHA1 Message Date
Matthias Clasen
cc73241c7b Merge branch 'wip/carlosg/controllers-backport' into 'gtk-3-24'
Wip/carlosg/controllers backport

See merge request GNOME/gtk!246
2018-07-18 00:23:37 +00:00
Balázs Meskó
ac358d2507 Update Hungarian translation 2018-07-17 23:11:18 +00:00
Carlos Garnacho
9ee60777e7 sm scroll 2018-07-16 15:44:35 +02:00
Carlos Garnacho
effdf3af74 demos: Add "Paint" demo 2018-07-16 15:43:43 +02:00
Carlos Garnacho
a8463953a4 gtk: Add GtkGestureStylus
This is a GtkGesture done to deal with stylus events from drawing tablets.
Those have a special number of characteristics that extend a regular
pointer, so it makes sense to wrap that.
2018-07-16 15:43:43 +02:00
Carlos Garnacho
7793aab5f0 gtkeventcontrollerkey: Add ::focus-in/out signals
And handle GDK_FOCUS_CHANGE events in order to emit those.
2018-07-16 15:43:43 +02:00
Carlos Garnacho
ecf9fa65b8 gtkeventcontrollerkey: Add get_group() call
Callers can use this function on a key-pressed/released signal
to find out the key event group, useful in a few places.
2018-07-16 15:43:43 +02:00
Carlos Garnacho
a32933b056 eventcontrollerkey: Add function to forward stuff elsewhere 2018-07-16 15:43:43 +02:00
Carlos Garnacho
e0f3e8a7e5 gtk: Add GtkEventControllerKey
This event controller is meant to replace usage from key-press/release-event
handlers all through. Optionally it can be set a GtkIMContext, so interaction
is carried by the controller.
2018-07-16 15:43:43 +02:00
Matthias Clasen
1f9de707f7 Add x/y to GtkEventControllerMotion::enter
We have this information available in enter events,
and having it in the controller signal as well makes
porting easier.

Update existing users.
2018-07-16 15:43:43 +02:00
Matthias Clasen
8b2c3a8c1a Add a simple motion eventcontroller
This can serve as a replacement for the legacy
event signals for enter/leave/motion notify.
2018-07-16 15:43:43 +02:00
Matthias Clasen
e7af3410cf Avoid excess notification for GdkEventControllerScroll::flags
We have a test that checks this, and it is the right thing to do.
2018-07-16 15:43:43 +02:00
Carlos Garnacho
84d3bfb6fd gtk: Remove CONSTRUCT_ONLY flag from GtkEventControllerScroll::flags
There is a gtk_event_controller_scroll_set_flags() call that's meant
to be called after construction (eg. due to scrolledwindow relayouts
hiding/showing scrollbars). The property shouldn't be construct-only
for consistence.
2018-07-16 15:43:43 +02:00
Carlos Garnacho
448551f31c gtkeventcontrollerscroll: Add some docs 2018-07-16 15:43:43 +02:00
Timm Bäder
7b8c036f8f eventcontrollerscroll: Emit ::scroll for -1/+1 discrete steps
The > 1 meant it only emits the signal for -2/+2 steps.
2018-07-16 15:43:43 +02:00
Carlos Garnacho
747be0f499 gtk: Add GtkEventControllerScroll
This is a GtkEventController implementation to handle mouse
scrolling. It handles both smooth and discrete events and
offers a way for callers to tell their preference too, so
smooth events shall be accumulated and coalesced on request.

On capable devices, it can also emit ::scroll-begin and
::scroll-end enclosing all ::scroll events for a scroll
operation.

It also has builtin kinetic scrolling capabilities, reporting
the initial velocity for both axes after ::scroll-end if
requested.
2018-07-16 15:43:43 +02:00
Benjamin Otte
9008f7702d window: Update opaque region if background-color changes
The opaque region is only set when the background color is opaque. So
we need to do something about it when the background color changes.

However, in the case where a size allocation is going to happen, we
already do this update in size_allocate(), so in that case avoid doing
it twice.
2018-07-13 15:02:47 +02:00
Bruno Lopes da Silva
df0454236c Update Brazilian Portuguese translation 2018-07-10 13:02:08 +00:00
Jakub Steiner
8373b906d4 Merge branch 'expander-size-3' into 'gtk-3-24'
HighContrast: Restore expander size

See merge request GNOME/gtk!210
2018-07-09 15:27:51 +00:00
Mario Blättermann
0bca6969d4 Update German translation 2018-07-07 19:48:26 +00:00
Samuel Thibault
660087db42 HighContrast: Restore expander size
Expanders used to be 16px high. With the move from the gtk2 rendering
to gtk3 rendering they shrunk to 12px, making them hard to see, because
it's now the icon which is 16px high and the icon contains transparent
borders.

This makes the HighContrast theme use 24px icons instead, to restore
16px expanders. This may expander some containers a bit.

Closes #1046
2018-07-03 19:27:15 +02:00
Jonas Ådahl
927004178f Merge branch 'fix_wayland_csd_announce' into 'gtk-3-24'
Fix gdk_wayland_window_announce_csd

See merge request GNOME/gtk!221
2018-07-03 10:14:57 +00:00
Daniel Boles
1b8de2d5fa Adwaita: Drop some unneeded overrides
The pseudoclasses work fine on the subnodes without having to also apply
`parent:class subnode`.
2018-07-02 21:45:06 +01:00
Daniel Boles
483d25f418 ModelButton: Add Since annotation on new prop 2018-07-02 20:31:45 +01:00
Daniel Boles
1d30ada735 ScrolledWindow: a couple of spelling/grammar fixes
(A) Put a space in "scrolled window" like the other doc comments
(B) Say "i.e." rather than "ie."
(C) Fix grammar from "makes [...] exactly reaches" to "exactly reach"
2018-07-02 20:11:12 +01:00
Daniel Boles
8a00551871 ScrolledWindow: Fix/improve doc of key bindings
Saying 'key + modifiers' is really weird, so reverse that, and explain
why there are 2 cited and what the difference between them is.
2018-07-02 20:09:37 +01:00
Daniel Boles
0ed3a77d29 ScrolledWindow: Add missing apostrophes 2018-07-02 20:07:23 +01:00
Matthias Clasen
29b61176bb Merge branch 'wip/gtk324.win.egl' into 'gtk-3-24'
Add an EGL renderer for GDK-Win32 for GTK+-3.24 (was: merge request !126)

See merge request GNOME/gtk!191
2018-07-02 17:18:26 +00:00
Matthias Clasen
174c4fa7ee Merge branch 'wip/aplazas/modelbutton-markup' into 'gtk-3-24'
ModelButton: Add 'use-markup' property

See merge request GNOME/gtk!219
2018-07-02 17:16:59 +00:00
Daniel Boles
08adcb6318 PlacesSidebar: Fix warning about signal parameters
@open_flags was not documented, and so:

jhbuild/checkout/gnome/gtk+-3/gtk/gtkplacessidebar.c:4743: Warning: Gtk:
incorrect number of parameters in comment block, parameter annotations
will be ignored.
2018-07-01 16:08:06 +01:00
Adrien Plazas
504eb89155 ModelButton: Add 'use-markup' property
Binds this property to the button's label, allowing a model button to
have text with markup.

This will be convenient for buttons like 'Online Accounts <sup>↗</sup>'.
2018-06-29 23:02:21 +02:00
Daniel Boles
b75b5e900a themes: Remove Raleigh
It has been extremely broken since the move to CSS gadgets/nodes, so
clearly no one is depending on it; nor does anyone seem to want to
resurrect it, and writing a Raleigh-inspired theme from scratch would be
faster if they did. So let's drop the dead weight from the build and lib

Now that we don't have Raleigh, the defaultvalue test has to be changed
to set Adwaita before checking the default values of style properties -
some of which Adwaita overrides in its CSS, meaning those would fail.
Not that it passed before anyway! But it does now after my other commit.

Note that I leave the last reference in gtk-zip.sh.in alone since that
hasn't been touched in 8 years and probably has plenty other problems...

Close https://gitlab.gnome.org/GNOME/gtk/issues/1187
2018-06-29 20:12:19 +01:00
Daniel Boles
ca4ec52c54 defaultvalue: Fix some very broken indentation
and while here, use the more typical : to separate the type and property
2018-06-29 19:57:06 +01:00
Daniel Boles
908d4f1d1f defaultvalue: Ignore property to actually pass
GtkFontChooserWidget:tweak-action gets set in init(), so we have to skip
testing that it is the default NULL for a GObject, or the test fails.
2018-06-29 18:57:43 +01:00
Daniel Boles
62573f299c defaultvalue: Stop warnings via new g_object_ref()
Now that it can propagate the type, we must explicitly cast to GObject*
to assign it, otherwise gcc shouts.
2018-06-29 18:46:09 +01:00
Daniel Boles
c0bf48c8ab defaultvalue test: Remove obsolete properties 2018-06-29 18:46:09 +01:00
Matthias Clasen
26f35fb941 Merge branch 'wip/cursor-output-scale-changes-3-24' into 'gtk-3-24'
wayland: Update cursor surface scale when output scale changes

See merge request GNOME/gtk!223
2018-06-29 14:30:51 +00:00
David Edmundson
d49335c59a wayland: Use correct enums in server_decoration_request_mode
The enum is duplicated in the spec for the manager and the decoration
object. We should be using the right ones. In practice they have the
same value, so this bug didn't cause any issues.
2018-06-28 18:51:12 +01:00
David Edmundson
f62c92783a wayland: Respond to server_decoration.mode events 2018-06-28 18:51:12 +01:00
David Edmundson
f3f4d40b89 wayland: Fix memory leak in server decoration object
The server decoration object becomes invaid when the wl_surface is
deleted. We should tidy it up then.
2018-06-28 18:51:12 +01:00
David Edmundson
b0bfe606aa wayland: Reset server decoration interface on window mapping
The wl_surface is destroyed and recreated when the window is
mapped/unmapped. As we have a new wl_surface we need to create a new
server_decoration object for that surface.
2018-06-28 18:50:50 +01:00
David Edmundson
32ae97f13a wayland: Explicitly request mode for both CSD and SSD modes
According to the spec compositors were to assume surfaces are CSD until
told otherwise. This means we need to send
org_kde_kwin_server_decoration_request_mode in both cases.

This fixes libreoffice under kwin, which would remove it's own headers
as per the manager's request but not inform kwin leaving it in the even
more broken state of having none.
2018-06-28 18:50:50 +01:00
Jonas Ådahl
3354d91090 wayland: Update cursor surface scale when output scale changes
Cursor surfaces didn't listen for output scale changes, meaning they
didn't adapt their scale when an output changed scale, which could
happen for example when changing the monitor scale via Settings.
2018-06-28 12:01:48 +02:00
Chun-wei Fan
b6db96cd1a GDK/Win32: Cleanup and further fix OpenGL/ES glitches
We also need to invalidate the OpenGL/ES window when we resize the
window via a mouse drag operation, so that we don't get glitches in such
situations, because they are not covered in GdkWindow's
impl_class->move_resize().

Make sure that we only force the invalidation when necessary (as it is
expensive), and clean up the gdkevents-win32.c code so that we include
gdkglcontext-win32.h in the right place instead of using an extern, as
we need to invalidate the window accordingly.
2018-06-28 15:33:42 +08:00
Chun-wei Fan
b2ea707614 GDK-Win32: Fix glitches when using EGL/ANGLE
We need to force redraws of the whole window when we are using EGL/ANGLE
during maximize, restore and Aerosnap ops so that we do not get glitches
in the resulting window.
2018-06-28 15:33:42 +08:00
Chun-wei Fan
af66faf604 Add a EGL renderer (via ANGLE) for Windows
This is for adding a EGL-based renderer which is done via the ANGLE
project, which translate EGL calls to Direct3D 9/11.  This is done as a
possible solution to issue #105, especially for cases where the needed
full GL extensions to map OpenGL to Direc3D is unavailable or
unreliable, or when the OpenGL implementation from the graphics drivers
are problematic.

To enable this, do the following:
-Build ANGLE and ensure the ANGLE libEGL.dll and libGLESv2.dll are
 available.  A sufficiently-recent ANGLE is needed for things to
 work correctly--note that the copy of ANGLE that is included in
 qtbase-5.10.1 is sufficient.  ANGLE is licensed under a BSD 3-clause
 license.  Note also that Visual Studio 2013 or later is required to
 build ANGLE from QT-5.10.1, but the 2013-built ANGLE DLLs can work
 without without problems for GTK+ that is built with Visual Studio
 2008 or later.
-Build libepoxy on Windows with EGL support enabled.
-Define GDK_WIN32_ENABLE_EGL when building gdk-win32.lib when building
 with Visual Studio, or pass in --enable-win32-gles during configure
 when building with MinGW/mingw-w64.
-Prior to running GTK+ programs, the GDK_GL envvar needs to contain
 gles.

Known issues:
-Only OpenGL ES 3 is supported, ANGLE's ES 2 does not support the needed
 extensions, notably GL_OES_vertex_array_object, but its ES 3 support is
 sufficient.
-There is no autodetection or fallback mechanism to enable using
 EGL/Angle automatically yet.  There is no plans to do this in this
 commit.

Thanks to LRN for pointing out that we should #include
"win32/gdkwin32.h" instead of #include "gdkwin32.h" for gdkgl.c.  LRN
also did the autotools portion of this patch.

Further notes about the autotools --enable-win32-gles option, fom LRN:

This adds --enable-win32-gles option, which enables the
code for GLES renderer.  This commit also adds tests for WGL and
EGL in epoxy.  The absence of WGL is highly unlikely (it's enabled
by default), but checking for EGL when GLES is enabled is necessary,
as EGL is disabled in Windows builds of epoxy by default.
2018-06-28 15:33:42 +08:00
Emmanuele Bassi
5afc01d995 Merge branch '324.win32.build' into 'gtk-3-24'
GTK+: Fix dist and build on Windows

See merge request GNOME/gtk!207
2018-06-27 18:26:02 +00:00
Chun-wei Fan
f353ba3acb demos/gtk-demo/gtkfishbowl.c: Include gtk/fallback-c89.c
...in place of math.h, as we are using round(), which is possibly not
provided by the compiler since we don't require a C99 compiler in
GTK+-3.x and gtk/fallback-c89.c does include math.h anyways.
2018-06-26 16:40:18 +08:00
Chun-wei Fan
eebf151f2a gtk/: Fix build without PangoFT2 and HarfBuzz
On Windows HarfBuzz and PangoFT2 are optional, so we need to ensure that
we only build the bits that require HarfBuzz and PangoFT2 when needed.
We may need to see later whether we can get the needed functionality in
gtkfontchooserwidget.c with the Windows APIs without the need of
HarfBuzz nor PangoFT2 (and starting programs on Windows using FontConfig
is very slow).
2018-06-26 16:40:18 +08:00
Chun-wei Fan
e8d3899461 gtk/Makefile.am: Dist the newly-added private headers
We need to dist language-names.h and script-names.h so that we won't
be missing headers in a dist tarball.
2018-06-26 16:40:11 +08:00