Commit Graph

45864 Commits

Author SHA1 Message Date
Mario Blättermann
d3f18abf7d Updated German translation 2016-01-21 17:48:25 +01:00
Carlos Garcia Campos
0f7b4dad0f cssstyleproperty: Make it possible to query CSS opacity with gtk_style_context_get()
Add a query implementation to opacity property. Also fix the assert in
gtk_css_style_property_register() to allow registering properties with
query but without assign function.

https://bugzilla.gnome.org/show_bug.cgi?id=760933
2016-01-21 14:58:57 +01:00
Lapo Calamandrei
bd4aaa1285 Adwaita: first css check/radio implementation
draw checks and radios with css istead of relying on png assets.
2016-01-21 14:48:47 +01:00
Matthias Clasen
77a6d976b2 css: Fix refcounting thinko in -gtk-recolor
gtk_css_style_get_value does not return a reference.
So don't unref the return value without taking one.
2016-01-21 08:42:55 -05:00
Matthias Clasen
b4bfba00c4 Handle svg image assets in Adwaita
The build glue for collecting all the assets in Adwaita as
resources was assuming that they are all pngs, and tried to
preprocess them into embedded GdkPixbufs.
Fix it to leave svgs unmolested, so they can be recolored
at runtime.
2016-01-21 08:20:06 -05:00
Matthias Clasen
419f2c670d css: Handle image loading errors graciously
If we fail to load the image for a -gtk-recolor() expression,
fall back to using the image-missing icon instead of crashing,
and include more details in the warning message.
2016-01-21 08:19:37 -05:00
Matthias Clasen
ffc4f8ee11 Forgotten file 2016-01-21 08:18:28 -05:00
Matthias Clasen
52326e909a Adwaita: Set a text color for lists
Symbolic icons in list boxes came out white-on-white in the
inspector. Set an explicit text color to prevent that.
2016-01-20 22:53:47 -05:00
Matthias Clasen
e33bda3078 inspector: Show full allocation + clip
Previously, we were only showing the size of the allocation
and clip area. But there is no good reason to hide the position
of these rectangles, so add them, in the traditional format
of X geometry strings: wxh+x+y
2016-01-20 22:52:05 -05:00
Matthias Clasen
449a9c419a inspector: Refine typography
Use thin spaces in the formatting of monitor sizes.
2016-01-20 22:51:25 -05:00
Matthias Clasen
c2d4fd6b93 Fix GtkShortcutsWindow crash
GtkShortcutsWindow is among the 'cheating' containers that iterate
over indirect children in forall, and this is now triggering
an assertion in gtk_container_propagate_draw.

For now, just exclude the cheating containers from the assertion.
Eventually, this needs a better solution.
2016-01-20 19:33:16 -05:00
Ray Strode
5150849a67 wayland: don't pass in width and height to create_shm_pool
create_shm_pool doesn't need the width or height, it just needs
the total size.  By passing it in, we're requiring it to redo
stride calculation unnecessarily.

This commit drops the width and height parameters and makes the
function just take the total size directly.

https://bugzilla.gnome.org/show_bug.cgi?id=760897
2016-01-20 14:29:15 -05:00
Ray Strode
1e001eaa78 wayland: clean up stride calculation when creating shm surface
Right now, we assume the stride for the image surface needs to
be 4 byte aligned.  This is, in fact, true, but it's better to
ask cairo for the alignment requirement directly rather than
assume we know the alignment rules.

This commit changes the code to use cairo_format_stride_for_width
to calculate a suitable rowstride for pixman.

https://bugzilla.gnome.org/show_bug.cgi?id=760897
2016-01-20 14:29:15 -05:00
Ray Strode
c8deaeabdd wayland: unlink shm file earlier in create function
create_shm_pool unlinks the temporary file a little,
too late. It should be unlinked before ftruncate()
is called for two reasons:

1) if ftruncate fails, the file is currently not
getting cleaned up at all
2) in theory, if the file is public some other process
could muck with it

This commit just moves the unlink call a little higher
up.

https://bugzilla.gnome.org/show_bug.cgi?id=760897
2016-01-20 14:29:15 -05:00
Carlos Garnacho
6c1bee2377 GtkNotebook: Unify two private variables
Button state was being kept in two separate variables, which lead
to slight confusions in DnD that caused the notebook to ignore the
first click after DnD happened from (within) it. Unify these two
into one, which helps us keep better track of the really pressed
buttons.
2016-01-20 19:57:23 +01:00
Matthias Clasen
da31eb4f64 container: Don't create too-large clips
gdk_rectangle_union will happily add all the worlds pixels
to the union if the initial rectangle is initialized to all
zeros. Therefore, explicitly check for an empty rectangle
before calling it.
2016-01-20 13:44:34 -05:00
Matthias Clasen
51f05a00ae Clarify docs for gdk_rectangle_union
This function does not ignore empty rectangles. Since this
is a fairly subtle point about the behavior, it is worth
spelling this out in the documentation. We've had a bug
open about this for a long time:

https://bugzilla.gnome.org/show_bug.cgi?id=464528
2016-01-20 13:44:34 -05:00
Carlos Garnacho
4f6ea16c2e wayland: Protect against NULL offers on gdk_drag_status() implementation
If we're called untimely, we might end up crashing here when poking the
NULL wl_data_offer.
2016-01-20 18:55:51 +01:00
Carlos Garnacho
261622733c gtkdnd: Disconnect GdkDragContext signals on gtk_drag_source_info_free()
Otherwise it may still be tricked into emitting further signals at a
time we've already destroyed the GtkDragSourceInfo passed as callback
user data.
2016-01-20 18:53:03 +01:00
Benjamin Otte
f535251507 notebook: Get rid of during_reorder variable
Use operation == OPERATION_REORDER instead.
2016-01-20 17:37:37 +01:00
Benjamin Otte
c162a0cca8 notebook: Properly hide drag window
Move code to properly reinsert the tab label to where it belongs.
The if has the distinction between reparented-to-dnd-window and
just-changed-the-gdk-window-to-draw-to right there.

https://bugzilla.gnome.org/show_bug.cgi?id=760754
2016-01-20 17:37:37 +01:00
Benjamin Otte
099662998a notebook: Get rid of during_detach member
use operation == OPERATION_DETACH instead.
2016-01-20 17:37:37 +01:00
Matthias Clasen
5fd7b85d2b Add a function to get affected area for background
The new function, gtk_render_background_get_clip answers the
question: what pixels are affected if I call gtk_render_background ?

The long-term goal is to have APIs that answer this question for
all rendering primitives.
2016-01-20 09:41:01 -05:00
Ondrej Holy
b2eaed62f6 file chooser: Allow saving even if executable attribute is not set
Commit 8e975b2 (Bug 753969) introduced check of parent accessibility.
Consequently it is not possible to save file if executable attribute
is not set, which might happen for some gvfs backends. Let's assume
that the folder is accessible even if the attribute is not set.

https://bugzilla.gnome.org/show_bug.cgi?id=760881
2016-01-20 14:09:46 +01:00
Kalev Lember
fef545c623 configure: Require wayland >= 1.9.91
Needed since commit 1045dda035
2016-01-20 13:00:10 +01:00
Benjamin Otte
e3f8316d08 viewport: Don't destroy pixelcache while it's still used
Removing the child unsets the pxielcache's style context...
2016-01-20 05:10:16 +01:00
Matthias Clasen
e1068255b3 gtk-demo: Fix font features sources
The resources had the prefix, causing the ui file not
to show up.
2016-01-19 22:47:19 -05:00
Benjamin Otte
9cb0a97bb5 viewport: Set the pixel cache background from the child
The viewport itself doesn't move, so we cannot use it as the pixel
cache's background. Use the bottommost using element instead, which is
the viewport's child.

This might need adaptations in themes as we want the backgroud to be
opaque to speed up pixel cache performance.
2016-01-20 04:37:05 +01:00
Matthias Clasen
bb92428112 notebook: Implement rtl flipping for CSS nodes
Use gtk_box_gadget_reverse_children and gtk_css_node_reverse_children
to flip the children of the header_gadget and the tabs_gadget when
appropriate.

Add new CSS node tests to verify that the node order is updated
as expected in all cases.
2016-01-19 21:40:47 -05:00
Benjamin Otte
0304817d81 css: AFFFECTS_TEXT causes a resize, not a redraw
And we schedule the resize conditionally only when text is rendered but
don't do that check for the redraw.
2016-01-20 02:37:45 +01:00
Benjamin Otte
065aa296ed widget: Properly invalidate when CSS font properties change. 2016-01-20 02:19:42 +01:00
Piotr Drąg
e06c08a291 Updated POTFILES.in and POTFILES.skip 2016-01-20 01:43:38 +01:00
Matthias Clasen
02dabcfd2b 3.19.7 2016-01-19 09:19:32 -05:00
Matthias Clasen
e3b49b2d6c Update expected output of a11y tests
This reflects my recent change to messagedialog titles.
2016-01-19 09:19:31 -05:00
Matthias Clasen
cba7b2c56b Simplify foreign drawing example
This is code will be copied, so take out unnecessary complication.
2016-01-19 08:36:27 -05:00
Matthias Clasen
cccaf1d16b Use actual drop status
We have this information in the XDND protocol, so we don't have
to blindly assume that the drop succeeded.
2016-01-19 14:17:36 +01:00
Carlos Garnacho
40b28ac66a gdk: Document the functions that don't need calling on managed DnD
These functions will be automatically called by the windowing backend.
The usual hooks to run this from in gtk/ shouldn't even happen, but
it is worth to document which calls are expected and which aren't.
2016-01-19 14:17:36 +01:00
Carlos Garnacho
5b1d96234d wayland: Set weak reference on the current grab window
If the grab window is destroyed the grab will be implicitly removed,
although we won't get GdkSeat:ungrab called in order to clear our
internal window<->seat relation entirely. Setting a weak ref will
nullify the pointer we keep on the seat to the window, avoiding the
expected crashes.
2016-01-19 14:17:36 +01:00
Carlos Garnacho
be3f0dad82 wayland: Unset button modifiers on pointer enter
Due to implicit grabs, we basically can guarantee that the pointer
won't have any buttons pressed at the time of wl_pointer.enter.
Seems like a good place to unset any button modifiers that might
have been left stale by compositor grabs.
2016-01-19 14:17:36 +01:00
Carlos Garnacho
1045dda035 wayland: Implement DnD actions as per wl_data_device v3
Implement as a managed GdkDragContext, which actually fits nicely
with the drag-and-drop model in wayland.
2016-01-19 14:17:36 +01:00
Carlos Garnacho
0747a60129 wayland: Add internal gdk_wayland_seat_set_global_cursor()
This can be used for cases (like DnD) where there isn't necessarily
a grab, but we want a global pointer cursor.
2016-01-19 14:17:36 +01:00
Carlos Garnacho
8d47617623 gtkdnd: Reset widget controllers when starting DnD.
Otherwise there's no full guarantees that this will happen.
2016-01-19 14:17:36 +01:00
Carlos Garnacho
2b703b61cf gtk: Add private gtk_widget_reset_controllers()
This is a one-shot call that can be called on the places we
know we're taking input away.
2016-01-19 14:17:35 +01:00
Carlos Garnacho
e4f5e31b8b gtkdnd: Optionally use gdk_drag_context_manage_dnd()
When this is in use, there's essentially a bunch of dead code here.
When all backends are ported, we'll be able to remove grab/cursor
management plus a bunch of source-side event handlers.
2016-01-19 14:17:35 +01:00
Carlos Garnacho
bfee45e6f9 x11: Implement gdk_drag_context_manage_dnd()
This includes managing input events and source-side DND events,
as well as setting the appropriate cursor and emitting the signals
that are expected in this mode of operation.
2016-01-19 14:17:35 +01:00
Carlos Garnacho
ed5da43afb gdk: Add gdk_drag_get_cursor()
This function (most similar to gtk_drag_get_cursor() helps figure out
the right cursor that applies to a given action. To be used by the
various backends.
2016-01-19 14:17:35 +01:00
Carlos Garnacho
f6b8fb5a6b gdk: Run DnD internal handlers before the main event handler
We'll be stealing those to GTK+, if the GdkDragContext manages
the DnD operation.
2016-01-19 14:17:35 +01:00
Carlos Garnacho
edc4374a63 gdk: Allow internal management of source-side DnD
We've traditionally left GTK+ to handle the input side of things,
letting GDK only manage the windowing-specific messaging. This
way of splitting responsibilities is not compatible however with
some backends, we must fold then input management at the DnD stage
into GDK (and backends) domain.

The gdk_drag_context_manage_dnd() call is meant to be the entry
point for this mode of operation, if the drag and drop operation
becomes managed, the caller (i.e. gtkdnd.c) doesn't need to perform
grabs, nor manage input events itself.

As a consequence of this, different aspects now belong to the
backend GdkDragContext implementation:
- Because the caller doesn't see keyboard events anymore,
  keyboard navigation must be managed in GDK, so is the decision
  of the current action based on modifiers/button pressed.
- Because the caller won't see input events in general, the lifetime
  of the drag and drop operation is now communicated through the
  ::drop-performed, ::dnd-finished and ::cancel events
- Because the caller doesn't participate anymore on the action
  being chosen, the pointer cursor must be set by the backend.
  The caller is rather notified of the final action through the
  ::action signal.

The caller is still responsible of dealing with the corresponding
GdkSelection, ensuring its ownership and communicating the supported
mimetypes.
2016-01-19 14:17:35 +01:00
Benjamin Otte
a50baba160 widget: Call gdk_window_mark_paint_from_clip() again
The proper window to call it is the event window, as the call itself
ignores non-native windows anyway.
2016-01-19 14:12:53 +01:00
Marek Černocký
f64bb38aa7 Fixed typo childen->children 2016-01-19 12:52:58 +01:00