gtk4.git
7 years agogdk: do not deactivate surface on keyboard grabs
Samuel Thibault [Thu, 19 Apr 2018 12:10:23 +0000 (14:10 +0200)]
gdk: do not deactivate surface on keyboard grabs

When pressing e.g. a window manager shortcut, which acquires keyboard grab,
Xorg would send FocusOut NotifyGrab then FocusIn NotifyUngrab.  Currently
gdk would then deactivate the current surface, which makes accessibility
screen readers think that we have switched to a non-accessible application
and came back again, and thus reannounce the application frame etc. which we
don't want when e.g. just raising volume.

And actually, receiving FocusOut NotifyGrab does not mean losing the
X focus, it only means an application aqcuired a grab, i.e. it is
temporarily stealing keyboard events. On Wayland, this isn't even
notified actually.

This commit makes gdk only deactivate surfaces when there was an actual
focus switch to another window, as determined by has_focus_window (instead
of just has_focus), which happens either normally through FocusOut with
NotifyNormal, or during grabs through FocusOut with NotifyWhileGrabbed.

Fixes #85

7 years agoMisc documentation fixes
Matthias Clasen [Sat, 28 Apr 2018 20:23:32 +0000 (16:23 -0400)]
Misc documentation fixes

Close some gaps in gdk docs.

7 years agoDocument GdkMemoryTexture
Matthias Clasen [Sat, 28 Apr 2018 20:20:19 +0000 (16:20 -0400)]
Document GdkMemoryTexture

7 years agoMore doc build fixes
Matthias Clasen [Sat, 28 Apr 2018 20:02:34 +0000 (16:02 -0400)]
More doc build fixes

If only the errors would make it back to stderr.

7 years agoMore doc build fixes
Matthias Clasen [Sat, 28 Apr 2018 18:13:34 +0000 (14:13 -0400)]
More doc build fixes

7 years agoAdd offset nodes to the docs
Matthias Clasen [Sat, 28 Apr 2018 14:04:23 +0000 (10:04 -0400)]
Add offset nodes to the docs

7 years agoFix the gdk doc build
Matthias Clasen [Sat, 28 Apr 2018 00:14:03 +0000 (20:14 -0400)]
Fix the gdk doc build

GdkDrawingContext no longer exists.

7 years agoUpdate Friulian translation
Fabio Tomat [Sat, 28 Apr 2018 09:19:30 +0000 (09:19 +0000)]
Update Friulian translation

7 years agodnd: Make GdkDragContext::device a (construct-only) property
Benjamin Otte [Fri, 27 Apr 2018 10:32:17 +0000 (12:32 +0200)]
dnd: Make GdkDragContext::device a (construct-only) property

Also remove gdk_drag_context_set_device() and insist on backends using
the property.

7 years agowayland: Create drop contexts on demand
Benjamin Otte [Fri, 27 Apr 2018 10:25:59 +0000 (12:25 +0200)]
wayland: Create drop contexts on demand

Instead of creating and reusing the same one from start to finish.

7 years agodragsource: Use capture phase for gesture
Benjamin Otte [Fri, 27 Apr 2018 01:31:39 +0000 (03:31 +0200)]
dragsource: Use capture phase for gesture

Otherwise buttons don't work as drag sources, and we like to do that.

7 years agogtk-demo: Always have at least 1 icon in the fishbowl
Benjamin Otte [Wed, 25 Apr 2018 22:17:23 +0000 (00:17 +0200)]
gtk-demo: Always have at least 1 icon in the fishbowl

When changing the widget type, don't start out with 0 icons.

7 years agoUpdate Esperanto translation
Kristjan SCHMIDT [Thu, 26 Apr 2018 23:24:32 +0000 (23:24 +0000)]
Update Esperanto translation

7 years agoimcontextsimple: ensure W32 code only runs on W32 displays
Руслан Ижбулатов [Thu, 26 Apr 2018 17:42:49 +0000 (17:42 +0000)]
imcontextsimple: ensure W32 code only runs on W32 displays

gdk_win32_keymap_check_compose() shouldn't be called for
non-W32 displays (i.e. when using broadway or other backends
that could be made to run on Windows).

7 years agoAdd gtk_printer_get_hard_margins_for_paper_size
Adrian Johnson [Thu, 12 Apr 2018 09:31:37 +0000 (11:31 +0200)]
Add gtk_printer_get_hard_margins_for_paper_size

to retreive paper size specific hard margins and use this
to set the hard margins in the print context.
(modified by Marek Kasik <mkasik@redhat.com>)

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

7 years agoUpdate Friulian translation
Fabio Tomat [Thu, 26 Apr 2018 07:52:37 +0000 (07:52 +0000)]
Update Friulian translation

7 years agomenu: Set up callback with a return function
Carlos Garnacho [Wed, 25 Apr 2018 17:07:50 +0000 (19:07 +0200)]
menu: Set up callback with a return function

The function hooked up to the ::key-pressed signal should have
a return value. Pointed out by Peter Bloomfield.

7 years agocomboboxtext: GTK_DISABLE_SINGLE_INCLUDES is not a thing
Benjamin Otte [Wed, 25 Apr 2018 14:14:00 +0000 (16:14 +0200)]
comboboxtext: GTK_DISABLE_SINGLE_INCLUDES is not a thing

What you don't find when laughing at vcpkg having a CMake build file for
GTK.

7 years agoUpdated Spanish translation
Daniel Mustieles [Wed, 25 Apr 2018 11:18:01 +0000 (13:18 +0200)]
Updated Spanish translation

7 years agonotebook: Fetch directly current event state/device
Carlos Garnacho [Wed, 25 Apr 2018 00:10:01 +0000 (02:10 +0200)]
notebook: Fetch directly current event state/device

gtk_get_current_event() returns a new reference to the event, it should
be freed across various return branches to avoid the event leak, or we
just fetch the little stuff we're interested in.

7 years agorange: Do not unconditionally stop events in event handler
Carlos Garnacho [Tue, 24 Apr 2018 22:35:00 +0000 (00:35 +0200)]
range: Do not unconditionally stop events in event handler

Prevents keybindings from working on scales.

7 years agocombobox: Do not unconditionally stop events in event handler
Carlos Garnacho [Tue, 24 Apr 2018 22:26:02 +0000 (00:26 +0200)]
combobox: Do not unconditionally stop events in event handler

Prevents combobox menus from being closed.

7 years agocairocontext: Remove fallback implementations
Benjamin Otte [Mon, 23 Apr 2018 16:42:36 +0000 (18:42 +0200)]
cairocontext: Remove fallback implementations

Now that all Cairo contexts are ported to managing cairo surfaces
themselves, the old fallback code that didi the managing is no longer
needed.

Also clarify the behavior of gdk_cairo_context_cairo_create() wrt the
vfunc by doing the early exit and the clipping outside of it.

7 years agoGDK W32: Switch to GdkCairoContext
Руслан Ижбулатов [Tue, 24 Apr 2018 15:14:23 +0000 (15:14 +0000)]
GDK W32: Switch to GdkCairoContext

* Remove DC refcounting (we trust GDK to always do
  begin_frame/end_frame calls in pairs)
* Now that there's no GDK-provided double-buffer up the stack,
  double-buffering is implemented here
  (though it's disabled by default - in my tests it didn't provide
   any visual improvements, but did decrease performance).
* For some reason delaying window resizes until the point where
  we need to blit the double-buffer into the window leads
  to visual glitches, so doulbe-buffered windows are resized
  in begin_frame, same as non-double-buffered ones.
* New code to clear the paint region, for all drawing modes.
  Hopefully, it isn't duplicated anywhere up the stack.
* GL has its own context now, so remove any GL-related comments.
* Layered windows are still used (because cairo actually works
  better with them)
* A bit more code re-use for layered windows
* Some functions that were local to gdksurface-win32.c are made
  usable for the whole backend
* Drag-indicator drawing is temporarily commented out to match
  a similar change in X11 backend

7 years agobroadway: Handle offset nodes
Alexander Larsson [Tue, 24 Apr 2018 14:05:28 +0000 (16:05 +0200)]
broadway: Handle offset nodes

7 years agobroadway: Handle cairo nodes of type recording surface
Alexander Larsson [Tue, 24 Apr 2018 14:04:57 +0000 (16:04 +0200)]
broadway: Handle cairo nodes of type recording surface

7 years agobroadway: Add and use GdkBroadwayDrawContext
Alexander Larsson [Tue, 24 Apr 2018 13:39:53 +0000 (15:39 +0200)]
broadway: Add and use GdkBroadwayDrawContext

7 years agobroadway: Add basic GdkCairoContext implementation
Alexander Larsson [Tue, 24 Apr 2018 12:31:49 +0000 (14:31 +0200)]
broadway: Add basic GdkCairoContext implementation

7 years agobroadway: Call _gdk_surface_update_size when resizing surface
Alexander Larsson [Tue, 24 Apr 2018 12:31:24 +0000 (14:31 +0200)]
broadway: Call _gdk_surface_update_size when resizing surface

7 years agodrawcontext: Only pass the region that matters
Benjamin Otte [Mon, 23 Apr 2018 21:26:14 +0000 (23:26 +0200)]
drawcontext: Only pass the region that matters

We used to pass 2 regions to GdkDrawCotnext.end_frame() but code was
confusing what they meant. So we now don't do that anymore and only pass
the region that matters: The frame region.

7 years agodrawcontext: Add gdk_draw_context_in_frame() API
Benjamin Otte [Mon, 23 Apr 2018 16:24:29 +0000 (18:24 +0200)]
drawcontext: Add gdk_draw_context_in_frame() API

This makes the previous gdk_draw_context_is_drawing() function public
under a new name.

I decided against the old name because we use the term "frame" for a
drawing operation, so I wanted to have this boolean flag reuse the term.

7 years agodrawcontext: Move variable into private struct
Benjamin Otte [Mon, 23 Apr 2018 16:17:29 +0000 (18:17 +0200)]
drawcontext: Move variable into private struct

... and get rid of duplicate variable in the process.

7 years agogdk: Move begin/end_frame() functions
Benjamin Otte [Mon, 23 Apr 2018 15:28:55 +0000 (17:28 +0200)]
gdk: Move begin/end_frame() functions

As they require a draw context and the draw context is already bound to
the surface, it makes much more sense and reduces abiguity by moving
these APIs to the draw context.

As a side effect, we simplify GdkSurface APIs to a point where
GdkSurface now does not concern itself with drawing anymore at all,
apart from being the object that creates draw contexts.

7 years agogdk: Get rid of GdkDrawingContext
Benjamin Otte [Fri, 20 Apr 2018 23:22:19 +0000 (01:22 +0200)]
gdk: Get rid of GdkDrawingContext

All information is kept in GdkDrawContext these days, so use that one.

7 years agogdk: Get rid of gdk_drawing_context_get_clip()
Benjamin Otte [Fri, 20 Apr 2018 22:58:53 +0000 (00:58 +0200)]
gdk: Get rid of gdk_drawing_context_get_clip()

Use the identical gdk_draw_context_get_frame_region() instead.

7 years agogdk: Add gdk_draw_context_get_frame_region()
Benjamin Otte [Fri, 20 Apr 2018 22:47:35 +0000 (00:47 +0200)]
gdk: Add gdk_draw_context_get_frame_region()

This does the same as gdk_drawing_context_get_clip().

7 years agogdk: Remove gdk_gl_context_get_damage()
Benjamin Otte [Fri, 20 Apr 2018 15:04:36 +0000 (17:04 +0200)]
gdk: Remove gdk_gl_context_get_damage()

Remove it only form public API, because we still use the vfunc to figure
out the damage area in begin_frame().

7 years agogsk: Refactor damage computation for GL renderer
Benjamin Otte [Fri, 20 Apr 2018 14:07:34 +0000 (16:07 +0200)]
gsk: Refactor damage computation for GL renderer

Previously, we got the damage, then computed the changed area, then
started a frame with that changed area.

But starting a frame computes the damage for us.

So now we start a frame, then get the damage area from that, then
compute the change area.

7 years agowayland: Rewrite Cairo rendering
Benjamin Otte [Tue, 17 Apr 2018 21:05:41 +0000 (23:05 +0200)]
wayland: Rewrite Cairo rendering

Also, split it into its own file - which was the original reason for
looking at this code, the rewrite was an unintentional side effect.

This changes the context to create surfaces on demand.
So whenever the compositor holds onto a surface while GDK wants to
render, it just creates a new surface. If the compositor releases
surfaces, we will retain one for the next frame to be rendered, but free
all extra ones.
This way, we should get to a stage where we have exactly as many
surfaces as needed and never allocate/free any.

7 years agox11: Move implementation of Cairo context backends
Benjamin Otte [Sat, 14 Apr 2018 00:29:23 +0000 (02:29 +0200)]
x11: Move implementation of Cairo context backends

Also, don't implement SurfaceClass.ref_cairo_surface() anymore. This
means calls to it will crash now. But as they only happen in the generic
GdkCairoContext implementation, we shouldn't be affected by that.

Plus, once all backends have been ported, that call is going away
anyway.

7 years agosurface: Merge function into only caller
Benjamin Otte [Sun, 15 Apr 2018 16:42:23 +0000 (18:42 +0200)]
surface: Merge function into only caller

7 years agogdk: Remove GDK_DEBUG=cairo-image
Benjamin Otte [Sat, 14 Apr 2018 20:45:33 +0000 (22:45 +0200)]
gdk: Remove GDK_DEBUG=cairo-image

This is the default now - at least until cairo rendering gets split
into backends.

7 years agosurface: Fold function into only user
Benjamin Otte [Sat, 14 Apr 2018 20:35:46 +0000 (22:35 +0200)]
surface: Fold function into only user

7 years agocairocontext: Turn cairo_create() function into a vfunc
Benjamin Otte [Sat, 14 Apr 2018 00:17:47 +0000 (02:17 +0200)]
cairocontext: Turn cairo_create() function into a vfunc

7 years agogdk: Remove unused GL setting
Benjamin Otte [Sat, 14 Apr 2018 00:10:36 +0000 (02:10 +0200)]
gdk: Remove unused GL setting

7 years agogdk: Add Cairo context implementations for all backends
Benjamin Otte [Thu, 12 Apr 2018 14:48:31 +0000 (16:48 +0200)]
gdk: Add Cairo context implementations for all backends

And make the GdkCairoContext as abstract.

The idea of this and thje following commits is to get rid of all
Cairo code in gdksurface.c (and $backend/gdksurface-$backend.c)
by moving that code into the Cairo context files.
In particular, the GdkSurfaceClass.begin_frame/end_frame()
functions (which are currently exclusively used by the Cairo code
should end up being moved to GdkDrawContextClass.begin/end_frame().

This has multiple benefits:

1. It unifies code between the different drawing contexts.
   GL lives in GLContext, Vulkan in VulkanContext and Cairo in
   CairoContext. In turn, this makes it way easier to reason about
   what's going on in surface-specific code. Currently pretty much
   all backends do things wrong when they want to sync to drawing
   or to the frame clock.

2. It makes the API of GdkSurface smaller. No drawing code (apart
   from creating the contexts) needs to remain.

3. It confines Cairo to the Drawcontext, thereby making it way
   more obvious when backends are still using it in situations
   where it may now conflict with OpenGL (like when doing the dnd
   failed animation or in the APIs that I'm removing in this
   branch).

4. We have 2 very different types of Cairo contexts: The X/win32
   model, where we have a natively supported Cairo backend but do
   double buffering ourselves and use similar surfaces and the
   Wayland/Broadway model where we use image surfaces without any
   Cairo backend support and have to submit the buffers manually.
   By not sharing code between those 2 versions, we can make the
   actual code way smaller. We also get around the need to create
   1x1 image surfaces in the Wayland backend where we pretend
   there's a native Cairo surface.

7 years agocairocontext: Move a function
Benjamin Otte [Thu, 12 Apr 2018 00:10:22 +0000 (02:10 +0200)]
cairocontext: Move a function

A function of GdkDrawingContext is only used when drawing with Cairo, so
move it to GdkCairoContext.

7 years agogdk: Move Cairo code from surface to CairoContext
Benjamin Otte [Wed, 11 Apr 2018 22:32:53 +0000 (00:32 +0200)]
gdk: Move Cairo code from surface to CairoContext

This just moves code, no actual changes to functionality are happening.

7 years agogdk: Add GdkCairoContext
Benjamin Otte [Wed, 11 Apr 2018 22:16:43 +0000 (00:16 +0200)]
gdk: Add GdkCairoContext

This does nothing but disallow passing NULL to gdk_surface_begin_paint()
and instead require this context.

The ultimate goal is to split out Cairo drawing into its own source file
so it doesn't clutter up the generic rendering path.

7 years agogtk-demo: Merge widgetbowl into fishbowl
Benjamin Otte [Tue, 24 Apr 2018 19:32:36 +0000 (21:32 +0200)]
gtk-demo: Merge widgetbowl into fishbowl

7 years agodemo: Clean up GtkFishbowl widget
Benjamin Otte [Tue, 24 Apr 2018 18:32:57 +0000 (20:32 +0200)]
demo: Clean up GtkFishbowl widget

1. Remove set_icons property
2. Make it a GtkWidget subclass
3. Add gtk_fishbowl_set_creation_func()
4. Make the widgetbowl use the new benchmarking infrastructure of the
   fishbowl

7 years agodemo: Move benchmarking implementation to fishbowl widget
Benjamin Otte [Tue, 24 Apr 2018 17:04:44 +0000 (19:04 +0200)]
demo: Move benchmarking implementation to fishbowl widget

7 years agoUpdate Esperanto translation
Kristjan SCHMIDT [Tue, 24 Apr 2018 19:17:30 +0000 (19:17 +0000)]
Update Esperanto translation

7 years agotestentrycompletion: Use the model we already got
Daniel Boles [Tue, 24 Apr 2018 12:40:02 +0000 (13:40 +0100)]
testentrycompletion: Use the model we already got

cherry-pick of gtk-3-22 commit af350b20b1c396ec55ca6a71eab23fdca6ffb784

7 years agoUpdate Russian translation
Stas Solovey [Tue, 24 Apr 2018 10:32:36 +0000 (10:32 +0000)]
Update Russian translation

7 years agosnapshot: Get rid of record_nodes flag
Benjamin Otte [Tue, 24 Apr 2018 02:02:55 +0000 (04:02 +0200)]
snapshot: Get rid of record_nodes flag

Instead, use GTK_DEBUG=snapshot for it.

7 years agorendernode: Remove gsk_render_node_set_name()
Benjamin Otte [Tue, 24 Apr 2018 01:46:44 +0000 (03:46 +0200)]
rendernode: Remove gsk_render_node_set_name()

And of course, gsk_render_node_get_name() is gone, too.
The replacement is of course debug nodes.

As a side effect, GskRenderNode is now *really* immutable.

7 years agosnapshot: Redo debug messages
Benjamin Otte [Tue, 24 Apr 2018 01:17:23 +0000 (03:17 +0200)]
snapshot: Redo debug messages

Instead of every snapshot function having debug messages, have an
explicit gtk_snapshot_push_debug() function that appends a debug node.

7 years agogsk: Add GskDebugNode
Benjamin Otte [Mon, 23 Apr 2018 22:41:48 +0000 (00:41 +0200)]
gsk: Add GskDebugNode

7 years agoMerge branch 'wip/matthiasc/emoji-picker' into 'master'
Matthias Clasen [Tue, 24 Apr 2018 00:38:20 +0000 (00:38 +0000)]
Merge branch 'wip/matthiasc/emoji-picker' into 'master'

Wip/matthiasc/emoji picker

See merge request GNOME/gtk!115

7 years agoDrop Ctrl-Shift-e support
Matthias Clasen [Mon, 23 Apr 2018 04:29:21 +0000 (00:29 -0400)]
Drop Ctrl-Shift-e support

Now that we have Emoji completion, drop the rather limited
Ctrl-Shift-e support in GtkIMContextSimple, and leave this
sequence to input methods.

7 years agowidget-factory: add emoji completion to an entry
Matthias Clasen [Tue, 15 Aug 2017 21:35:03 +0000 (17:35 -0400)]
widget-factory: add emoji completion to an entry

7 years agoentry: Add emoji completion
Matthias Clasen [Sat, 19 Aug 2017 18:08:15 +0000 (14:08 -0400)]
entry: Add emoji completion

Pop up completions when the text in the entry matches :word:
This functionality has to be enabled using the enable-emoji-completion
property.

7 years agoAdd an emoji completion popup
Matthias Clasen [Sat, 19 Aug 2017 18:06:47 +0000 (14:06 -0400)]
Add an emoji completion popup

This widget provides entry completion-like functionality
for Emoji codes like :grin: or :kiss:.

7 years agoExport some entry functions privately
Matthias Clasen [Sat, 19 Aug 2017 18:07:59 +0000 (14:07 -0400)]
Export some entry functions privately

This will be used in the following commits.

7 years agowayland: Allow a NULL inhibitors hash table
Emmanuele Bassi [Mon, 23 Apr 2018 09:57:07 +0000 (10:57 +0100)]
wayland: Allow a NULL inhibitors hash table

The shortcuts inhibitors hash table is created when we create a
GdkWaylandWindow implementation for a GdkWindow, and it's destroyed once
we finalize the instance. The fake "root" window we create for the
Wayland display does not have a backing native window, so the shortcuts
inhibitors hash table is set to NULL; this causes a critical error
message when calling g_hash_table_destroy() on it. The finalization of
the root window happens when we close a display connection.

We should use g_clear_pointer(), instead, as it's NULL safe.

Without this change, the displayclose test fails, as all warnings are
considered fatal.

7 years agogtk-demo, testgtk: Don't pass an integer to fabs
Ting-Wei Lan [Sun, 22 Apr 2018 13:51:36 +0000 (21:51 +0800)]
gtk-demo, testgtk: Don't pass an integer to fabs

It looks like a mistake which compilers are likely to warn.

7 years agoimcontextxim: Don't assign a variable to itself
Ting-Wei Lan [Sun, 22 Apr 2018 13:48:35 +0000 (21:48 +0800)]
imcontextxim: Don't assign a variable to itself

This causes clang to show warnings.

7 years agoFix header guards
Ting-Wei Lan [Sun, 22 Apr 2018 13:45:19 +0000 (21:45 +0800)]
Fix header guards

They were found by clang.

7 years agobuild: Use cc.links to check linker arguments
Ting-Wei Lan [Sun, 22 Apr 2018 13:42:03 +0000 (21:42 +0800)]
build: Use cc.links to check linker arguments

Instead of hard-coding linker flags for a specific operating system and
a specific compiler, we can should cc.links to test them, so they can be
used on more operating systems and compilers.

7 years agobuild: Make the default setting work on non-Linux Unix-like systems
Ting-Wei Lan [Sun, 22 Apr 2018 12:47:32 +0000 (20:47 +0800)]
build: Make the default setting work on non-Linux Unix-like systems

All of the four platform-dependent backends are enabled by default. It
is usually a good default because it requires users to explicitly choose
backends they want to use. Rules in meson.build also automatically
disable unavailable backends for macOS, Windows, Linux, so users on
these 3 major platforms don't have to manually disable things when
running meson commands.

However, meson.build doesn't do the same thing for other Unix-like
systems, which is acceptable but not ideal. To make it easier to build
GTK+ on these systems, the Linux case, which enables X11 and Wayland and
disables Win32 and Quartz, is made the default for all operating systems
that are not Windows or macOS.

This commit also changes most 'host_machine.system()' calls to os_*
variables, which are easier to read and less likely to be used wrongly.

7 years agoUpdate Spanish translation
Daniel Mustieles [Mon, 23 Apr 2018 14:18:20 +0000 (14:18 +0000)]
Update Spanish translation

7 years agowayland: Allow a NULL inhibitors hash table
Emmanuele Bassi [Mon, 23 Apr 2018 09:57:07 +0000 (10:57 +0100)]
wayland: Allow a NULL inhibitors hash table

The shortcuts inhibitors hash table is created when we create a
GdkWaylandWindow implementation for a GdkWindow, and it's destroyed once
we finalize the instance. The fake "root" window we create for the
Wayland display does not have a backing native window, so the shortcuts
inhibitors hash table is set to NULL; this causes a critical error
message when calling g_hash_table_destroy() on it. The finalization of
the root window happens when we close a display connection.

We should use g_clear_pointer(), instead, as it's NULL safe.

Without this change, the displayclose test fails, as all warnings are
considered fatal.

7 years agoMerge branch 'wip/lantw/improve-freebsd-build-and-fix-warnings' into 'master'
Matthias Clasen [Mon, 23 Apr 2018 02:40:00 +0000 (02:40 +0000)]
Merge branch 'wip/lantw/improve-freebsd-build-and-fix-warnings' into 'master'

Improve meson.build for FreeBSD and reduce the number of warnings during compilation

See merge request GNOME/gtk!123

7 years agoWidget: Add missing space in new warning
Daniel Boles [Sun, 22 Apr 2018 22:12:18 +0000 (23:12 +0100)]
Widget: Add missing space in new warning

7 years agothemes: Fix a new comment
Daniel Boles [Sun, 22 Apr 2018 21:20:57 +0000 (22:20 +0100)]
themes: Fix a new comment

bah.

7 years agothemes: Fix swapped borders on RTL PathBar buttons
Daniel Boles [Sun, 22 Apr 2018 20:45:18 +0000 (21:45 +0100)]
themes: Fix swapped borders on RTL PathBar buttons

.linked assumes the container is a GtkBox, which is documented as never
flipping children in RTL, so :first-child is always the left child, etc.
GtkBox does that by reordering its CSS nodes when the direction changes.

But most widgets don’t do that, so :first|last-child are 1st/last ADDED
and swap sides in RTL. GtkPathBar is so, and ignoring that in our themes
meant that in RTL, its left/right buttons got each other’s borders. Yuk!

This patch adds the groundwork for supporting widgets like that, via the
%linked_flippable placeholder, and applies that to override buttons in
  filechooser .path-bar.linked > button
so that the correct borders get applied to those buttons when using RTL.

Note that I select only PathBars within a FileChooser because we also
have NautilusPathBar, which also uses widget.path-bar – but *does* flip
its nodes for RTL already, so letting that get affected broke it again!

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

7 years agoCheckMenuItem: Fix insert_after|before() here too
Daniel Boles [Sun, 22 Apr 2018 20:22:45 +0000 (21:22 +0100)]
CheckMenuItem: Fix insert_after|before() here too

See the previous commit.

There may be other cases of these being swapped by Gadget conversions,
but hopefully someone else will find and fix those before I have to…

Close https://gitlab.gnome.org/GNOME/gtk/issues/200

7 years agoMenuItem: Fix broken args to insert_before|after()
Daniel Boles [Sun, 22 Apr 2018 20:17:29 +0000 (21:17 +0100)]
MenuItem: Fix broken args to insert_before|after()

The widget & its parent were swapped to each other’s place in the calls.

https://gitlab.gnome.org/GNOME/gtk/issues/200

7 years agoWidget: Show widget name/addrs if fail to reparent
Daniel Boles [Sun, 22 Apr 2018 20:17:24 +0000 (21:17 +0100)]
Widget: Show widget name/addrs if fail to reparent

so we can more easily get an idea of where the problematic code is

https://gitlab.gnome.org/GNOME/gtk/issues/200

7 years agoWidget: Trivially fix arg name in non-doc comment
Daniel Boles [Sun, 22 Apr 2018 20:07:50 +0000 (21:07 +0100)]
Widget: Trivially fix arg name in non-doc comment

7 years agoMenuButton: popover connects to menu_deactivate_cb
Daniel Boles [Sun, 22 Apr 2018 15:25:54 +0000 (16:25 +0100)]
MenuButton: popover connects to menu_deactivate_cb

This was missed (even before my recent patches).

https://gitlab.gnome.org/GNOME/gtk/issues/199

7 years agoMenuButton: Disconnect newly added signal handler
Daniel Boles [Sun, 22 Apr 2018 15:25:07 +0000 (16:25 +0100)]
MenuButton: Disconnect newly added signal handler

Otherwise, we do stuff we shouldn't, as the failing pipeline showed:
https://gitlab.gnome.org/GNOME/gtk/pipelines/9431

https://gitlab.gnome.org/GNOME/gtk/issues/199

7 years agoMenuButton: Clarify NULL popup/over/menu/model doc
Daniel Boles [Sun, 22 Apr 2018 15:02:55 +0000 (16:02 +0100)]
MenuButton: Clarify NULL popup/over/menu/model doc

7 years agoMenuButton: Drop ref to Popover on its ::destroy
Daniel Boles [Sun, 22 Apr 2018 13:52:27 +0000 (14:52 +0100)]
MenuButton: Drop ref to Popover on its ::destroy

Otherwise, if the Popover is destroyed before the MenuButton, the latter
still had a non-NULL but invalid instance and tried to use it in dispose

Close https://gitlab.gnome.org/GNOME/gtk/issues/199

7 years agoEntry: Show optional style classes in node diagram
Daniel Boles [Wed, 18 Apr 2018 23:50:50 +0000 (00:50 +0100)]
Entry: Show optional style classes in node diagram

7 years agoa11y/ScrolledWin|IconView: Connect signals safely
Juan Pablo Ugarte [Thu, 19 Oct 2017 18:16:43 +0000 (15:16 -0300)]
a11y/ScrolledWin|IconView: Connect signals safely

Use g_signal_connect_data() instead of g_signal_connect_object()
to make sure the callback gets disconnected when the data object
is destroyed. This avoids problems in garbage-collected bindings.

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

7 years agoUpdate Polish translation
Piotr Drąg [Sun, 22 Apr 2018 14:13:56 +0000 (16:13 +0200)]
Update Polish translation

7 years agogtk-demo, testgtk: Don't pass an integer to fabs
Ting-Wei Lan [Sun, 22 Apr 2018 13:51:36 +0000 (21:51 +0800)]
gtk-demo, testgtk: Don't pass an integer to fabs

It looks like a mistake which compilers are likely to warn.

7 years agoimcontextxim: Don't assign a variable to itself
Ting-Wei Lan [Sun, 22 Apr 2018 13:48:35 +0000 (21:48 +0800)]
imcontextxim: Don't assign a variable to itself

This causes clang to show warnings.

7 years agoFix header guards
Ting-Wei Lan [Sun, 22 Apr 2018 13:45:19 +0000 (21:45 +0800)]
Fix header guards

They were found by clang.

7 years agobuild: Use cc.links to check linker arguments
Ting-Wei Lan [Sun, 22 Apr 2018 13:42:03 +0000 (21:42 +0800)]
build: Use cc.links to check linker arguments

Instead of hard-coding linker flags for a specific operating system and
a specific compiler, we can should cc.links to test them, so they can be
used on more operating systems and compilers.

7 years agobuild: Make the default setting work on non-Linux Unix-like systems
Ting-Wei Lan [Sun, 22 Apr 2018 12:47:32 +0000 (20:47 +0800)]
build: Make the default setting work on non-Linux Unix-like systems

All of the four platform-dependent backends are enabled by default. It
is usually a good default because it requires users to explicitly choose
backends they want to use. Rules in meson.build also automatically
disable unavailable backends for macOS, Windows, Linux, so users on
these 3 major platforms don't have to manually disable things when
running meson commands.

However, meson.build doesn't do the same thing for other Unix-like
systems, which is acceptable but not ideal. To make it easier to build
GTK+ on these systems, the Linux case, which enables X11 and Wayland and
disables Win32 and Quartz, is made the default for all operating systems
that are not Windows or macOS.

This commit also changes most 'host_machine.system()' calls to os_*
variables, which are easier to read and less likely to be used wrongly.

7 years agowidget: Position changes don't require a redraw
Benjamin Otte [Sun, 22 Apr 2018 00:46:00 +0000 (02:46 +0200)]
widget: Position changes don't require a redraw

Well, they don't require a redraw of the widget, because the widget
itself didn't change.
They require a redraw of the parent, because that now displays the
widget in a different position.

And this means we can keep the cache of the widget's render node.

My fishbowl numbers are through the roof^W water surface. Vulkan gets
4000 now.

7 years agodemo: Don't add more icons all the time
Benjamin Otte [Sun, 22 Apr 2018 00:45:11 +0000 (02:45 +0200)]
demo: Don't add more icons all the time

If adding new icons takes longer than a second, the frame clock should
run before we add even more icons...

7 years agobuild: Remove 'name' kwarg from has_function calls
Timm Bäder [Sat, 21 Apr 2018 17:30:12 +0000 (19:30 +0200)]
build: Remove 'name' kwarg from has_function calls

They cause warnings with later meson versions.

7 years agobuild: Fix copy/paste error
Timm Bäder [Sat, 21 Apr 2018 17:24:25 +0000 (19:24 +0200)]
build: Fix copy/paste error

7 years agoAlways use #ifdef for G_ENABLE_DEBUG
Timm Bäder [Sat, 21 Apr 2018 17:18:20 +0000 (19:18 +0200)]
Always use #ifdef for G_ENABLE_DEBUG

Release builds don't define it to 0, they just don't define it. Avoid
the compilation warning we get otherwise.

7 years agosizerequestcache: Directly initialize some locals
Timm Bäder [Sat, 21 Apr 2018 17:01:06 +0000 (19:01 +0200)]
sizerequestcache: Directly initialize some locals

Declaring them and initializing them in the same block of code without
an empty line in between is really just confusing.

7 years agoUse inlined gtk_widget_get_display version in a few places
Timm Bäder [Sat, 21 Apr 2018 15:04:41 +0000 (17:04 +0200)]
Use inlined gtk_widget_get_display version in a few places

We can safely do this whenever we already made sure that the given
pointer is a valid GtkWidget.