Commit Graph

47829 Commits

Author SHA1 Message Date
Matthias Clasen
96d8afbccb Add a portal helper
Instead of open-coding checks for sandboxing in multiple
places, add a helper function that caches the information.

https://bugzilla.gnome.org/show_bug.cgi?id=768499
2016-07-08 00:06:14 -04:00
Owen W. Taylor
b840a59766 Change the priority of the window-close idle to G_PRIORITY_DEFAULT
If we have an application that never goes idle (or takes a long time to
go idle), the close buttons in CSD decoration don't work properly.
While it's not clear why the usage of an idle was added in the first
place, keep on using it to avoid unexpected reentrancy problems, but
change the priority to G_PRIORITY_DEFAULT.

https://bugzilla.gnome.org/show_bug.cgi?id=768485
2016-07-06 09:50:21 -04:00
Matthias Clasen
c7654c737c Add a css parser test for background-blend-mode 2016-07-05 13:16:43 -04:00
Matthias Clasen
93f20315d1 gtk3-demo: Simplify the blendmodes example a bit
Just put all of the template into the resource.
2016-07-04 09:59:25 -04:00
Olivier Fourdan
e032c83822 wayland: remove unneeded statement
seat->pointer_info.focus is already set to NULL 2 lines above, no need to
repeat it there.
2016-07-04 09:46:24 +02:00
Olivier Fourdan
298221bfba wayland: return child only in device_query_state()
On X11, device_query_state() uses XIQueryPointer() which will return a
child window only if the pointer is within an actual child of the given
window.

Wayland backend would return the pointer->focus window independently of
the given window, but that breaks the logic in get_device_state() and
later in gdk_window_get_device_position_double() because the window is
searched based on coordinates from another window without sibling
relationship, breaking gtkmenu sub-menus further down the line.

Fix the Wayland backend to mimic X11's XIQueryPointer() to return a
child only if really a child of the given window.

That's the most sensible thing to do to fix the issue, but the API here
seems to be modeled after the X11 implementation and the description of
gdk_window_get_device_position_double() is not entirely accurate.

https://bugzilla.gnome.org/show_bug.cgi?id=768016
2016-07-04 09:46:18 +02:00
Piotr Drąg
4c01ab8945 Updated POTFILES.skip 2016-07-04 00:41:24 +02:00
Matthias Clasen
507e58df4e gtk3-demo: Make blendmodes example non-resizable
It doesn't need to.
2016-07-03 18:29:21 -04:00
Matthias Clasen
3c4be3c912 Fix parsing of some css properties
Our property parser stops at the first match when looking for
enums, so we need to order our values so that we don't end up
with prefixes of longer names being found first.

I noticed this when the parser tried to interpret
background-blend-mode: color-burn; as "color, with junk at the end".

It also affects animation-direction, which is also fixed here.
2016-07-03 17:54:19 -04:00
Matthias Clasen
34986231f4 css parser: Improve an error message
Say what property we are dealing with when we complain about the
value.
2016-07-03 17:46:30 -04:00
Georges Basile Stavracas Neto
1d93cc2b0b demo: add a demo for blend modes
After introducing the CSS blend mode enum values and including
the background-blend-mode CSS property, it is very important to
actually provide an example of the new feature.

This patch adds a new demo to gtk3-demo which shows how the
background-blend-mode CSS property works.

https://bugzilla.gnome.org/show_bug.cgi?id=768305
2016-07-03 17:24:47 -04:00
Georges Basile Stavracas Neto
27fea1c4fc css: add documentation for background-blend-mode
After introducing the new CSS property, it is natural to
add some documentation explaining the behavior of it and
our support coverage.

https://bugzilla.gnome.org/show_bug.cgi?id=768305
2016-07-03 17:24:47 -04:00
Georges Basile Stavracas Neto
369db4a406 css: add background-blend-mode support
CSS supports blend modes, in which a series of layers are
merged together according to the given operation or set of
operations.

Support for blend modes landed on Cairo, which exposes all
the commons and also the exquisites blend modes available.
Adding support for blend modes, then, is just a matter of
using the available Cairo operations.

This patch adds the background-blend-mode CSS enum property,
and adapts the background rendering code to blend the backgrounds
using the available blend modes when they're set.

https://bugzilla.gnome.org/show_bug.cgi?id=768305
2016-07-03 17:24:47 -04:00
Matthias Clasen
c8a74a1f50 Simplify the xfce session manager support
We don't have to check name owners twice; reuse the information
we already have.
2016-07-03 17:22:14 -04:00
Eric Koegel
3c7cd7ac23 GtkApplication: Add support for the Xfce session manager
Xfce4-session-manager added support for managing dbus based clients.
This patch adds support for checking if Xfce session manager is
around after trying the gnome one.
https://bugzilla.gnome.org/show_bug.cgi?id=693203
2016-07-03 14:56:48 -04:00
Matthias Clasen
22b6df025e Fix example Makefiles
Put OBJS before LIBS on the commandline to make things
work better.

https://bugzilla.gnome.org/show_bug.cgi?id=768142
2016-07-03 13:54:11 -04:00
Matthias Clasen
a43fce058c print dialog: Apply initial capabilities
I was struggling to understand why calling
gtk_print_unix_dialog_set_manual_capabilities (...,0)
was not having the expected effect of hiding the preview
button. The initial capabilities were not applied at all.
2016-07-02 18:08:38 -04:00
Carlos Garnacho
0d30ad279f wayland: Separate selection buffers and other per-selection atom data
This has most notably impact in selection buffers, because those were
shared across all selection atoms. This turned out wrong on 2 situations:
- Because the selection atom was set at SelectionBuffer creation time, the
  GDK_SELECTION_NOTIFY events generated will have unexpected info if the
  buffer is attempted to be reused for another selection.
- Anytime different selections imply different stored content for the same
  target.

This is better separated into per-selection buffers, so it's not possible
to get collisions if a same target is used across different selections.

https://bugzilla.gnome.org/show_bug.cgi?id=768177
2016-06-30 14:10:26 +02:00
Carlos Garnacho
4b003a75aa wayland: Implement gdk_utf8_to_string_target
The sanitize_utf8() function has been copied from X11 so both
backends behave the same. This allows interaction with older clients
(mainly through Xwayland, and the STRING selection target) that
request non-utf8 text.

https://bugzilla.gnome.org/show_bug.cgi?id=768082
2016-06-30 14:10:26 +02:00
Chun-wei Fan
51444b7909 gtk/gtkstylecascade.c: Fix formatting
My previous patch on this file did not take into the account of the
formatting, sorry!
2016-06-30 18:00:47 +08:00
Ray Strode
386d17db6d headerbar: don't throw a warning if title widget is hidden
commit 0015ebc4a8 reworked
some of the titlebar size allocation code.  Those changes
inadvertently introduced a warning when the application sets
the headerbar title widget to be hidden.

This commit fixes that warning.

https://bugzilla.gnome.org/show_bug.cgi?id=768184
2016-06-29 09:27:33 -04:00
Ignacio Casal Quinteiro
b480d9c2ed configure: fix "AC_RUN_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS" 2016-06-29 15:16:54 +02:00
Ignacio Casal Quinteiro
46748b420a gdk: actually fix the previous commit
We do not want it on windows
2016-06-29 15:10:39 +02:00
Ignacio Casal Quinteiro
38fbe68e83 gdk: do not provide display command line argument on windows
There is no need to specify a display on windows.
2016-06-29 15:07:17 +02:00
Timm Bäder
92de947d5e GtkWindow: Check for GtkWidget-window-dragging in multipress gesture
This partly reverts 9f5b9c0e07, which
removed the check for GtkWidget-window-dragging in the multipress
gesture. This check is still needed for widgets which have this style
property set (e.g. menubars and toolbars) can maximize the window on
double click -- but those widgets which have it set to FALSE shouldn't
maximize the window.
2016-06-28 21:42:55 +02:00
Ondrej Holy
0c1cc9832f gtkfilesystem: Improve heuristics to detect remote filesystem
Use G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE to detect remote filesystems
instead of hardcoded list of filesystem types.

Bump required GLib version accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=767965
2016-06-28 10:55:06 +02:00
Timm Bäder
9f5b9c0e07 GtkWindow: Fix dragging on non-titlebar widgets 2016-06-27 19:23:12 +02:00
Timm Bäder
d52f6ff710 widget: Don't unnecessarily export function
_gtk_widget_get_translation_to_window is only used in gtkwidget.c
2016-06-27 14:43:53 +02:00
Chun-wei Fan
5f525839da gtk/gtkstylecascade.c: Declare variables at beginning of block 2016-06-27 11:58:42 +08:00
Chun-wei Fan
cd44f6d875 Fix build of commit f23e99b
Commit f23e99b made use of snprintf(), which is not universally available.
Fix this by using g_snprintf().
2016-06-27 11:53:30 +08:00
Andika Triwidada
325fc60931 Updated Indonesian translation 2016-06-26 22:25:51 +00:00
Andika Triwidada
0587f250c3 Updated Indonesian translation
(cherry picked from commit 23673851b7)
2016-06-26 22:21:34 +00:00
Yosef Or Boczko
4731be0942 Updated Hebrew translation 2016-06-26 16:15:06 +03:00
Lapo Calamandrei
ebccc8b23f Adwaita: color the selection of entries with error...
...or warning style class applied.
This particular style bit wasn't converted to the saner 3.20 way
so `entry:selected` used in place of `entry selection`.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=768025
2016-06-25 18:29:51 +02:00
Lapo Calamandrei
d74e4af1a2 Adwaita: restrict infobar styling to, well, infobars
we used to style infobars by using the .info, .question, .warning
and .error selectors directly, which used to be ok when we had just
styleclasses all over the place, now it needs to be more specific
or it interferes with everything with those styleclasses applied
like entries.
2016-06-25 18:17:59 +02:00
Andika Triwidada
b5920a22e6 Updated Indonesian translation 2016-06-25 07:57:53 +00:00
Andika Triwidada
21c94dea5e Updated Indonesian translation
(cherry picked from commit 3abb9ffa91)
2016-06-25 03:19:08 +00:00
Ray Strode
0015ebc4a8 headerbar: support expand property for children
The header bar currently ignores the expand property on its
children. This commit changes the code to honor that property.

It divvies up any free space and distributes it equally to packed
children (with any left over space given out a pixel at a time
on a first come, first serve basis).

This commit also adds support for the title widget to be made
expandable.

It accomplishes this by using up the padding the title widget
is centered with.

https://bugzilla.gnome.org/show_bug.cgi?id=724332
2016-06-24 20:58:41 -04:00
Ray Strode
847a43c431 headerbar: compute nominal size of sides up front
In order to support the expand property on children, we're
going to need to look at the size of the packed children
on each side of the title widget, up front, before allocating
them (to compute how much extra allocation each expanded child
gets).

This commit lays the groundwork for that analysis by splitting
the size calculation of each side of the header bar outside
of the loop that allocates each child of the header bar.

https://bugzilla.gnome.org/show_bug.cgi?id=724332
2016-06-24 20:24:43 -04:00
Ray Strode
eccfce50d6 headerbar: simplify some size allocation code
With a headerbar, the widget in the center may be a label, constructed
internally, or a custom widget, constructed externally.  The size
allocation code needs to handle either case the same way for the most
part.  There's more than one place in the code that checks which of
the two widgets to use and does some operation on the selected one.

This commit simplifies the code by checking up front which one is the
center (title) widget and storing that in a temporary variable,
This allows reducing duplicated logic later on in the function.

https://bugzilla.gnome.org/show_bug.cgi?id=724332
2016-06-24 20:20:22 -04:00
Ray Strode
e0bebba470 headerbar: simplify calculation in size allocation code
There's some extraneous MIN() calls that have predetermined answers.

This commit drops them and then simplifies a few redudant checks into
one MIN call.

https://bugzilla.gnome.org/show_bug.cgi?id=724332
2016-06-24 20:19:32 -04:00
Matthias Clasen
8430be75ed Fix an array overrun
When I introduced the new input source enum value for
track points, I forgot that there is a fixed-size array
with names for those in the inspector.
2016-06-23 15:47:47 -04:00
Ray Strode
78eccd0db9 headerbar: don't use GTK_PACK_* as indices into array
The size allocation code maintains an array of two elements,
to track the allocation of children packed into the two sides
of a header bar. Sometimes this array is indexed with 0 and 1,
and sometimes its indexed with GTK_PACK_START and GTK_PACK_END.
The latter happen to have the values 0 and 1, respectively, but
that's not really obvious.

For clarity, this commit changes the code to index those arrays
consistently, sticking to 0 and 1 across the board.
2016-06-23 14:32:33 -04:00
Ray Strode
01eda209e1 headerbar: don't allocate both label and custom title
It's only possible to have a label or a custom title, not both.
The size allocate code confusingly treats them as independent.

That is confusing, because, as the code is written, it makes it
look like the space for the custom title isn't getting accounted
for.

This commit else-ifies some parts of the size allocate code for
clarity.
2016-06-23 14:32:33 -04:00
Tiago Santos
3947ff44c9 Updated Portuguese translation 2016-06-22 13:12:03 +00:00
Emmanuele Bassi
40ee61a686 gtk: Keep Firefox working in the DrawingContext world
Firefox does a bunch of interesting things with GTK.

If the top-level GtkWindow does not have a "csd" style class associated,
Firefox will happily draw the contents of the container used to render
HTML and XUL directly on the top level's GdkWindow; on the other hand,
if a "csd" style class is found, the MozContainer will create a new
child window, and draw on it.

Then, Firefox will proceed to disable double buffering on both the
top-level window and the MozContainer (unless they are backed by the
same GdkWindow, in which case only the top-level will be
single-buffered) *and* it will add a GDK_EXPOSURE_MASK flag to the
MozContainer events for good measure (even if this is only needed for
GTK+ 2.x).

After landing the GdkDrawingContext API in GdkWindow, GTK enabled
automatic double buffering on all top-level windows backed by a native
surface, ad most users of single buffering rely on child widgets instead
of top-levels, and we'd still like to have the same double buffering
behaviour for all top-levels on all backends. Obviously, with Firefox
disabling double buffering on the top-level window, the change broke
their drawing mechanism.

Ideally, Firefox could be fixed to not disable double buffering on the
top-level window when MozContainer has a separate GdkWindow — i.e. the
CSD case — but since we did introduce a slight change of behaviour in
fringe users of the GTK+ API, let's keep backwards compatibility with
the old code for a little while longer, and create an intermediate Cairo
context unbound from the GdkDrawingContext, like we used to do until
GTK+ 3.20.
2016-06-22 11:41:59 +01:00
Chun-wei Fan
c2ba9ca810 Visual Studio builds: Make .pc generation more flexible
Allow the use of ${exec_prefix} for libdir and includedir when passing
them in as arguments to the script.
2016-06-22 15:22:58 +08:00
Carlos Garnacho
f44b9ef1f0 GtkColorEditor: Keep ref on pre-popup focus widget
And ensure it's still visible before returning the keyboard focus to it.
Because of the extra ref, add a dispose handler that will ensure the
ref is lost (by popping down), although this should be already ensured
through other paths (eg. when the popup widget loses visibility).

This fixes a possible crash in dispose paths, where we might be restoring
focus on an already destroyed widget, and at a time where, if the toplevel
is being itself disposed, no new focus should be set.

https://bugzilla.gnome.org/show_bug.cgi?id=767849
2016-06-21 17:56:34 +02:00
Carlos Garnacho
3b98a2d935 demos: Simplify popovers demo
Don't do much unconventional stuff here. This is a demo, not a test.

https://bugzilla.gnome.org/show_bug.cgi?id=767851
2016-06-21 17:56:21 +02:00
Carlos Garnacho
ed227f9e7b GtkPopover: Honor widget margins when calculating tail position
If there are widget margins set, the whole popover will be displaced.
However the calculation of the tail position doesn't have this into
account, ending up with the tail being detached from the popover if
the margin grew too big.

We should not render the arrows invariably next to the GdkWindow edge,
but optionally displaced inside it depending on the widget margins.
Fixes the gtk3-demo "Popovers" demo case, whose GtkEntry popovers set
widget margins for some reason.

https://bugzilla.gnome.org/show_bug.cgi?id=767851
2016-06-21 17:54:42 +02:00