Compare commits

...

372 Commits

Author SHA1 Message Date
Bastien Nocera 44a46234e1 frame-clock: Fix typo in API documentation 2017-11-22 15:27:18 +01:00
Matej Urbančič 06193cad4d Updated Slovenian translation 2017-07-27 15:51:58 +02:00
Matej Urbančič 3031b6f8c7 Updated Slovenian translation 2017-07-27 15:50:50 +02:00
Bastien Nocera e878b0f691 image: Fix loading of pixdata GResources
Pixdata is deprecated but some software already use GtkImage widgets
with image data loaded from GResource-backed pixdata. As the
security-problem ridden pixdata loader was removed, we need to manually
check whether the GResource data is pixdata, and load it manually.

https://bugzilla.gnome.org/show_bug.cgi?id=781583
2017-07-12 15:47:10 +02:00
Matthias Clasen fd7e0c6827 3.20.10 2017-02-21 16:17:09 -05:00
Ignacio Casal Quinteiro bd725d3208 win32: rework how to enumerate the monitors
It is racy to enumerate first the monitors and then reenumerate
using the previous counter since at that point we might endup
getting a new monitor and crash on the assert.

https://bugzilla.gnome.org/show_bug.cgi?id=779002
2017-02-21 11:08:45 +01:00
Chris Martin 7ce53f3381 getting-started: typo tie->the
https://bugzilla.gnome.org/show_bug.cgi?id=775864
2017-02-05 20:03:26 +00:00
Sveinn í Felli 6209a8e306 Update Icelandic translation 2017-02-04 15:24:15 +00:00
Daniel Boles f3b1e4ebba searchentry: Fix typo in documentation 2017-01-31 09:48:16 +00:00
Daniel Boles bb63cb41f0 combobox: Fix documentation typo bx => box 2017-01-21 16:12:59 +00:00
Daniel Boles ea74712de8 menushell: Don’t dereference before typechecking 2017-01-20 22:19:33 +00:00
Daniel Boles 7f9ef6f9cb combobox: If typechecking, don’t dereference before 2017-01-20 21:38:12 +00:00
Daniel Boles 495456c3d1 combobox: popdown() the menu during unmap()
combo_box_popdown() of course doesn’t popdown our menu if it is NULL.
But the required call to this at end-of-life was in destroy(), by which
point dispose() already NULLed the menu, so Menu::popdown() would never
run, even if it should. Fix this by trying popdown() earlier in unmap().
Also, add a converse assurance that we don’t popup() while not mapped.
2017-01-20 21:31:50 +00:00
Daniel Boles 369fa0341b Scale: Always sync ::digits to Range::round-digits
The documents state that gtk_scale_set_digits() “causes the value of the
adjustment to be rounded off to this number of digits, so the retrieved
value matches the value the user saw.” Note the lack of any condition.

But in fact, if draw-value was false, rounding was disabled on the base
Range, so values that weren’t displayed weren’t rounded. This made the
docs wrong and made an apparently cosmetic detail alter functionality.

Fix by ensuring the number of digits set on Scale is always propagated
along to gtk_range_set_round_digits(), thus rounding to it in all cases
when the value changes, regardless of whether the value is displayed.

This doesn’t address the other idea from Bugzilla: that changing the
number of digits should clamp the _existing_ value if it’s more precise.
This contradicts digits docs in the base Range, but the above from Scale
can be read as implying it’ll happen. For now, that’s an open question.

https://bugzilla.gnome.org/show_bug.cgi?id=358970
2017-01-20 21:31:08 +00:00
Daniel Boles 320fe56ca0 Remove executable bit from C source files in tests 2017-01-20 21:27:17 +00:00
Daniel Boles db214bbd1b combobox: Move variables into narrowest scopes 2017-01-20 21:26:28 +00:00
Daniel Boles a9a90c7659 grid: Fix plural error in docs' @Short_description 2017-01-20 21:23:01 +00:00
Daniel Boles 90bca20555 revealer: Fix a typo in a function doc
Also, "ie" wasn't very clear, but fixing that to "i.e." would cause
truncation of the summary when processed by bindings using doxygen. So,
I replaced it with "in other words", which is no _less_ clear, at least.
2017-01-20 21:23:01 +00:00
Daniel Boles 41a07f9856 demos/icon-browser: increase default window size
...to get more than 1 row of icons to browse!

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

I've bumped the size a bit further, to 1024x768
2017-01-20 21:22:31 +00:00
Daniel Boles 4935441e99 scrolledwindow: Fix func summary being cut off in bindings using doxygen
...which treats the first '.' in doc comments as the end of the summary.
So, e.g., in gtkmm, get_kinetic_scrolling() is currently summarised as
"Changes the behaviour of @scrolled_window wrt." Not very informative!

No need for a period there & anyway, the phrase "wrt to" is superfluous,
and we have space to actually say "with regard to", so just do that now.
2017-01-20 21:22:23 +00:00
Carlos Garnacho 91417c6e04 gtkdnd: Remove unnecessary call
drag-data-delete is emitted based on the interchange of the
DELETE atom, which may well be set or bypassed locally by
the app. As such emitting it here is not right, the other
paths handling the DELETE atom interchange are still valid
and there.

https://bugzilla.gnome.org/show_bug.cgi?id=774726
2017-01-11 16:40:57 +01:00
Debarshi Ray b1524a8ade flowbox: Fix get_child_at_index crash with an invalid index
https://bugzilla.gnome.org/show_bug.cgi?id=775525
2016-12-15 10:38:59 +01:00
Lapo Calamandrei 45ebb6afc6 HC: progressbar style fix
Reset styling on the progress node when trough node has the `empty'
styleclass.

See https://bugzilla.gnome.org/show_bug.cgi?id=774695
2016-12-03 17:19:17 +00:00
Lapo Calamandrei 6db39715d9 Adwaita: progressbar style fix
Reset styling on the progress node when trough node has the `empty'
styleclass.

See https://bugzilla.gnome.org/show_bug.cgi?id=774695
2016-12-03 17:19:17 +00:00
Daniel Boles 6053713acd GtkProgressBar: trivial conditional optimisation
I'd hope the compiler would realise this for us, but let's be explicit.
2016-12-03 17:19:17 +00:00
Simon Steinbeiss 4ed5f5ed43 progressbar: add empty and full classes on trough based on fill-level
Pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=774695
2016-12-03 17:19:17 +00:00
Matthias Clasen 51a6a325d2 widget-factory: Better progressbar testing
Hook the two top progressbars up to the scale with marks.
Your turn, Lapo.
2016-12-03 17:17:17 +00:00
Cosimo Cecchi bec07e2847 Adwaita: make rubberband selection work again for libgd apps
libgd views still use the old style class.
2016-11-27 02:03:42 +01:00
Lapo Calamandrei 793265e020 Adwaita: dodge drop active style for window and decoration nodes
to hilight drop target there is a wildcard selector which turns
the border and shadow to green, this clearly shouldn't happen when
the whole window is a drop target.
2016-10-12 19:34:40 +02:00
Hannie Dumoleyn ed178415d9 Updated Dutch translation gtk+-properties3.20 2016-10-12 17:19:29 +02:00
Hannie Dumoleyn b64f94feba Updated Dutch translation gtk+ 3.20 2016-10-12 17:07:40 +02:00
Matthias Clasen 63240a7110 css: Complete the cross-fade implementation
We need to actually compute the images. Otherwise,
bad things happen when we try to draw.

https://bugzilla.gnome.org/show_bug.cgi?id=767391
2016-09-06 08:16:58 -04:00
Matthias Clasen 86852505a3 Fix whitespace 2016-09-06 08:16:52 -04:00
Matthias Clasen f9167e5c99 css: Set meaningful fallback color
This code was passing out-of-range values into
gdk_cairo_set_source_rgb, which cannot really make
anything better.
2016-09-06 08:16:47 -04:00
Matthias Clasen 680ee57a79 gtk3-demo: Avoid underallocating columns
Setting a fixed width on the columns causes the headers to be
be underallocated. It is not necessary either.
2016-09-06 08:16:36 -04:00
Matthias Clasen 1024e0893e label: take padding into account when measuring
When doing height-for-width measurements, we need to take
padding into account. This was causing various allocation
errors.

https://bugzilla.gnome.org/show_bug.cgi?id=770849
2016-09-06 08:03:53 -04:00
Matthias Clasen 1dca723864 label: Fix indentation
Trivial, but annoying.
2016-09-06 08:03:43 -04:00
Matthias Clasen 6dd558a183 range: Ensure we don't underallocate the highlight gadget
This was causing warnings in HighContrast.

https://bugzilla.gnome.org/show_bug.cgi?id=770614
2016-09-06 08:03:35 -04:00
Joaquim Rocha 80063414ff listbox: Select the last row on page down when there are few rows
When pressing page down doesn't retrieve a valid row (because the list
box has few rows), the last visible one should be selected instead.

https://bugzilla.gnome.org/show_bug.cgi?id=770703
2016-09-06 08:03:11 -04:00
Joaquim Rocha eb2a73704b listbox: Avoid crashing on page down if the list has few rows
The code always assumed that getting a row at a certain 'y' was
possible but if the list box has more empty space than rows then a
valid row may not be retrieved.

https://bugzilla.gnome.org/show_bug.cgi?id=770703
2016-09-06 08:03:05 -04:00
Arnaud Bonatti 8112b925a3 Use 'focused' everywhere.
https://bugzilla.gnome.org/show_bug.cgi?id=770624
2016-09-06 08:00:38 -04:00
Benjamin Otte 7298f8e94d Add braces to appease gcc
-ftrack-macro-expansion=0 doesn't like if statements without braces when
evaluating indentation levels.
2016-09-06 07:59:22 -04:00
Benjamin Otte 137c22e50c uimanager: Correctly indent code 2016-09-06 07:59:16 -04:00
Benjamin Otte 403f16766c a11y: Correctly indent code 2016-09-06 07:59:08 -04:00
Matthias Clasen 32679cb832 cell renderer text: Allow entries to shrink
Set a small max-width on entries used for editing cells, so they
adapt to small columns and don't overlap the next column.

https://bugzilla.gnome.org/show_bug.cgi?id=770374
2016-09-06 07:58:36 -04:00
Matthias Clasen 626190e275 Document window-icon related api as 'may not work'
Some platforms simply don't have window icons (such as Wayland).
2016-09-06 07:58:10 -04:00
Matthias Clasen 7ebc137190 notebook: Update arrow state when switching pages
Otherwise, we may end up showing clickable arrows that don't
do anything.

https://bugzilla.gnome.org/show_bug.cgi?id=770332
2016-09-06 07:58:01 -04:00
Matthias Clasen 0ba66846d7 scale: Document interaction between rounding and autoscrolling
This is a bit of a gotcha, so better document it.
2016-09-06 07:57:49 -04:00
Matthias Clasen 720988d962 gtk-demo: Make the scale demo fully functional
The adjustments need to have step-increment and page-increment
set up, or keynav and autoscrolling will not work.
2016-09-06 07:56:30 -04:00
Philip Withnall a98d7a7569 gtkbindings: Add an example for gtk_binding_entry_add_signal()
Otherwise the way the varargs are supposed to be used is completely
opaque.

https://bugzilla.gnome.org/show_bug.cgi?id=770236
2016-09-06 07:55:43 -04:00
Philip Withnall 8d059bb487 gtkbindings: Clarify that widgets need has-focus for bindings to work
https://bugzilla.gnome.org/show_bug.cgi?id=770242
2016-09-06 07:55:32 -04:00
Timm Bäder a59cb7ccff stylepropertyimpl: Remove double assignment 2016-09-06 07:54:48 -04:00
Timm Bäder f1bcbfa8c1 widget-factory: Don't initially show popover
It'll  be set as the popover of a GtkMenuButton later anyway which will
hide it again.
2016-09-06 07:53:48 -04:00
GNOME Translation Robot 856d360d3f Updated Scottish Gaelic translation 2016-09-05 12:38:13 +00:00
GNOME Translation Robot e295708854 Updated Scottish Gaelic translation 2016-09-05 12:28:50 +00:00
Baurzhan Muftakhidinov caacf5a5cf Updated Kazakh translation 2016-09-04 04:53:31 +00:00
Carlos Soriano 24c25d44a5 gtkplacessidebar: fix signal marshal
We were using __VOID for the SHOW_OTHER_LOCATION signal that
uses flags named SHOR_OTHER_LOCATION_WITH_FLAGS.
However, if a signal uses flags the marshal needs to use __FLAGS.

This patch addresses this using VOID__FLAGS as the marshaler parameter.

Thanks to Jan Steffens for pointing this out.

https://bugzilla.gnome.org/show_bug.cgi?id=770550
2016-08-29 15:39:20 +02:00
Lapo Calamandrei 43da663c9e Adwaita: increase border radius on button.circular...
...to allow huge circular buttons.
See https://bugzilla.gnome.org/show_bug.cgi?id=770166
2016-08-22 14:19:09 +02:00
Rafael Fontenelle e2453dc7cd Updated Brazilian Portuguese translation 2016-08-22 04:09:13 +00:00
Мирослав Николић 9ce672a289 Updated Serbian translation 2016-08-20 20:43:20 +02:00
Мирослав Николић b8aa684337 Updated Serbian translation 2016-08-20 20:43:00 +02:00
Matthias Clasen 53e92dcab2 3.20.9 2016-08-17 11:06:13 -04:00
Matthias Clasen c8ef3b1a60 Really fix underlinkage for shm_open
Reported in https://bugzilla.gnome.org/show_bug.cgi?id=769603
2016-08-17 09:57:00 -04:00
Andika Triwidada 88c463a58f Updated Indonesian translation 2016-08-15 06:40:21 +00:00
Andika Triwidada a5b3a3ec0c Updated Indonesian translation 2016-08-15 06:24:48 +00:00
Aurimas Černius 666e604949 Updated Lithuanian translation 2016-08-14 21:07:12 +03:00
Anders Jonsson 113684bf8e Updated Swedish translation 2016-08-13 10:24:30 +00:00
Anders Jonsson 4981f9d04b Updated Swedish translation 2016-08-13 10:21:43 +00:00
Ignacio Casal Quinteiro 67b294ef5d Use g_snprintf instead of snprintf.
snprintf is not compatible with msvc.
2016-08-10 12:29:01 +02:00
Marek Černocký 5922bf061a Updated Czech translation 2016-08-09 11:59:39 +02:00
Marek Černocký 96cf4afed1 Updated Czech translation 2016-08-09 11:56:51 +02:00
Matthias Clasen 92f2fd069d wayland: Link against librt
This is required for shm_open.

https://bugzilla.gnome.org/show_bug.cgi?id=769603
2016-08-07 16:13:54 -04:00
Matthias Clasen 9834ddfb2e headerbar: Fix size allocation
The GtkHeaderBar gadget implementation was subtly broken: it called
gtk_widget_set_allocation both in gtk_header_bar_size_allocate (with
the actual allocation) and in gtk_header_bar_allocate_contents (with
the content allocation of the main gadget). Dropping the second call
fixes the render node conversion for GtkHeaderBar.
2016-08-07 16:13:28 -04:00
Rafael Fontenelle d69ab7f70a Updated Brazilian Portuguese translation 2016-08-07 13:12:46 +00:00
Tiago Santos 5c44df5ec8 Updated Portuguese translation 2016-08-05 10:58:25 +00:00
Tiago Santos 42b8879e6b Updated Portuguese translation 2016-08-05 10:56:27 +00:00
Colomban Wendling 10c3a24836 GtkMenuButton: use :toggled instead of :clicked
:toggled is triggered on :clicked, so using :toggled lead to the menu
to be popped up at the same time, while allowing to use the toggle state
and avoiding any need to a hack to prevent recursion, which somehow
wasn't enough for double emission of GtkMenuToolButton:show-popup.

https://bugzilla.gnome.org/show_bug.cgi?id=769287
2016-08-04 23:43:45 +02:00
Balázs Úr 13a0402e42 Updated Hungarian translation 2016-08-04 21:05:52 +00:00
Balázs Úr 92ade378fb Updated Hungarian translation 2016-08-04 21:02:56 +00:00
Piotr Drąg df2882ebbf Updated Polish translation 2016-08-04 21:09:45 +02:00
Bernd Homuth 070c4f7486 Updated German translation 2016-08-04 18:38:09 +00:00
Bernd Homuth d41543c51f Updated German translation 2016-08-04 18:35:14 +00:00
Matthias Clasen 6cc9f1dba1 3.20.8 2016-08-04 12:52:15 -04:00
Matthias Clasen de9ba70e58 Revert "Improve external drives detection"
This reverts commit a01ee5a7b0.

I didn't mean to bump the GLib requirement in the stable branch.
2016-08-04 12:49:28 -04:00
Matthias Clasen 84eff45a17 3.20.7 2016-08-04 10:34:08 -04:00
Emmanuele Bassi 9ff9c4932f Update the docs for gtk_window_get_position()
Drop mentions of GnomeClient, and add mentions of different windowing
systems instead of just assuming that we're using X11.
2016-08-04 10:34:08 -04:00
Sébastien Wilmet b137afe6ba docs: GtkWidget::style-updated vs GtkStyleContext::changed
Explain the difference between those two signals.

Add "Since: 3.0" for GtkStyleContext::changed, since that signal has
been added in commit 9f84e101bf, present
since 2.91.6.

https://bugzilla.gnome.org/show_bug.cgi?id=769047
2016-08-04 10:34:08 -04:00
Sébastien Wilmet 5505bb2f2f docs: add missing info for gtk_widget_get_style_context()
It is important to know whether the returned object can or cannot
change, for a certain widget. For example to connect to the
GtkStyleContext::changed signal.

https://bugzilla.gnome.org/show_bug.cgi?id=769047
2016-08-04 10:34:08 -04:00
Cosimo Cecchi e43801d295 reftests: override GSETTINGS_SCHEMA_DIR when running tests
The reftest depends on a schema we install ourselves. Instruct GIO to
look in the build directory to avoid a cyclic dep.

https://bugzilla.gnome.org/show_bug.cgi?id=768930
2016-08-04 10:34:08 -04:00
Matthias Clasen d92d9171e2 Remove a few mentions of GtkVBox in the docs
We only have GtkBox nowadays.
2016-08-04 10:34:07 -04:00
Emmanuele Bassi 6afe00fb46 docs: Attempt a better explanation for gtk_widget_destroy()
Clarify the nature of this function, and the expectations after it's
been called.
2016-08-04 10:34:07 -04:00
Razvan Chitu 1957e71374 placesview: fix open action for locations without a mount or volume
In the "Other Locations" view, locations can be opened from the context menu
based on their mount or volume. However, some locations, like "Computer", do not
have either of those so they cannot be opened from the context menu. In order to
fix this, the file associated with the location can be used as well.

https://bugzilla.gnome.org/show_bug.cgi?id=768657
2016-08-04 10:34:07 -04:00
Emmanuele Bassi ae5fe1aa21 docs: Improve gdk_window_create_similar_image_surface()
The sizes passed are in device pixels and do not take into account the
scaling factor of the window itself. We cannot change the semantics of
the function, so let's at least add a warning for this trap door.
2016-08-04 10:34:07 -04:00
Matthias Clasen 6304913795 css parser: Improve an error message
Say what property we are dealing with when we complain about the
value.
2016-08-04 10:34:07 -04:00
Matthias Clasen 3fde17b0b6 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-08-04 10:34:07 -04:00
Matthias Clasen c6f9c45033 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-08-04 10:34:06 -04:00
Carlos Garnacho 974b755b4d 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-08-04 10:34:06 -04:00
Carlos Garnacho 694c1661b8 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-08-04 10:34:06 -04:00
Ray Strode 02a5fe87da 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-08-04 10:34:06 -04:00
Carlos Garnacho ba30d1e458 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-08-04 10:34:06 -04:00
Christian Hergert 74a8099261 listbox: short-circuit if no sort function is set
do_sort will crash if sort_func is not defined. Instead of adding a check
there in the hot path, just check for sort_func before invalidating the
sort of the underlying GSequence.
2016-08-04 10:34:06 -04:00
Olivier Fourdan c906dbc9f1 wayland: do not set PRIMARY selection if focus is lost
If keyboard focus is (already) lost, do not advertise PRIMARY selection.

https://bugzilla.gnome.org/show_bug.cgi?id=767848
2016-08-04 10:34:05 -04:00
Carlos Garnacho 86ece29797 treeview: Ensure the treeview has the implicit grab before grabbing focus
The cellrenderer signals might be taking the grab somewhere else, at which
point it's dubious we should attempt to take the keyboard focus into the
treeview.

This concretely breaks popovers triggered from cellrenderer signals on
button press, because the treeview will attempt to grab focus
inconditionally then.

https://bugzilla.gnome.org/show_bug.cgi?id=767468
2016-08-04 10:34:05 -04:00
Matthew Leeds 90d3c9b31a GtkActionHelper: Change a message to a warning
It's almost certainly a programmer error if an action isn't
activatable because its target and parameter type don't match.
This commit changes the existing g_message to a g_warning.

https://bugzilla.gnome.org/show_bug.cgi?id=767705
2016-08-04 10:34:05 -04:00
Matthias Clasen 8fd61c4f5a shortcuts window: Fix handling of significant xml chars
We are using markup in the labels, so we need to escape things
like < and >.

https://bugzilla.gnome.org/show_bug.cgi?id=767795
2016-08-04 10:34:05 -04:00
Ray Strode 0969dc59ef wayland: fall back to shm_open if memfd unavailable
Debian stable currently ships with a 3.16 kernel, so
it doesn't have memfd available.

This commit adds shm_open fall back code for that case
(for now).

https://bugzilla.gnome.org/show_bug.cgi?id=766341
2016-08-04 10:34:05 -04:00
Ray Strode 30e5ddfb63 wayland: fix error handling for memfd_create
We currently use syscall() directly to invoke memfd_create,
since the function isn't available in libc headers yet.

The code, though, mishandles how errors are passed from syscall().
It assumes syscall returns the error code directly (but negative),
when in fact, syscall() uses errno.

Also, the code fails to retry on EINTR.

This commit moves the handling of memfd create to a helper function,
and changes the code to use errno and handle EINTR.

https://bugzilla.gnome.org/show_bug.cgi?id=766341
2016-08-04 10:34:05 -04:00
Matthias Clasen 5f80715ffb Update GtkLabel::angle docs
We can have wrapped or ellipsized labels at an angle nowadays.
Still no selections though.
2016-08-04 10:34:04 -04:00
Matthias Clasen 8d34a176c7 scale, spinbutton: Avoid -0.0
This is a very longstanding bug; time to finally put it to rest.

https://bugzilla.gnome.org/show_bug.cgi?id=118959
2016-08-04 10:34:04 -04:00
Carlos Garnacho 310cd19dc8 searchenginetracker: Fix prefix searches
With the FTS5 query syntax, when using quotes to delimit the search phrase
the '*' token must happen after the quote, or will otherwise be considered
a character to match, go through the tokenizer, and end up ignored in
result.
2016-08-04 10:34:04 -04:00
Matthias Clasen 3b6eb70539 treeview: fix an off-by-one error
gtk_tree_view_get_path_at_pos() mistakenly identifies the first
pixel of all but the first column in a tree view as belonging to
the previous column.

https://bugzilla.gnome.org/show_bug.cgi?id=708148
2016-08-04 10:34:04 -04:00
Matthias Clasen b89ba25631 Make gtk_tooltip_trigger_tooltip_query work again
This was broken ever since we started looking at the
source device of the event.

https://bugzilla.gnome.org/show_bug.cgi?id=674215
2016-08-04 10:34:04 -04:00
Matthias Clasen 6ca325f6ef inspector: Ellipsize accessible description.
This string can be long, and we don't want to break the ui
2016-08-04 09:45:42 -04:00
Matthias Clasen 1790e7af77 viewport: Free gadgets in finalize
This is the right place for this.
2016-08-04 09:45:35 -04:00
Matthias Clasen 9de63a147c scrolled window: Free gestures and gadgets in finalize
This is the right place for this.
2016-08-04 09:45:28 -04:00
Matthias Clasen 88cd815efc range: Free gadgets in finalize
This is the right place for this.
2016-08-04 09:45:20 -04:00
Matthias Clasen 1a6129d815 notebook: Free gadgets in finalize
This is the right place for this.
2016-08-04 09:45:13 -04:00
Matthias Clasen 76f7e57fb6 menu: Free gadgets in finalize
This is the right place to do this.
2016-08-04 09:45:07 -04:00
Matthias Clasen 4763524052 button: Free gadgets and gestures in finalize
This is the right place to free them.
2016-08-04 09:45:01 -04:00
Timm Bäder c63dad2c53 entry: Fix undershoot position wrt entry icons
Draw them inside of the icons, which is where the text scrolls.
2016-08-04 09:43:37 -04:00
Matthias Clasen bf2e267526 Teach gtk-builder-tool to leave GtkDialog::border-width alone
This is one of the properties that need to be explicitly set.
2016-08-04 09:40:08 -04:00
Руслан Ижбулатов 9397158fbc GtkFileChooser: don't override already opened folder
When filechooer is re-used (instead of being created and destroyed
every time it's needed), it might happen that the directory the
application wishes to initially show is the same directory that
was shown last time the filechooser was used. In that case, make sure
filechooser knows that it does not need to do its default "select $pwd
or $home" routine.

https://bugzilla.gnome.org/show_bug.cgi?id=766122
2016-08-04 09:39:57 -04:00
Matthias Clasen f7e57b5eeb Update migration guide a bit
Resize grips are no more.
2016-08-04 09:39:43 -04:00
Matthias Clasen 98c74b6e5c Fix a duplicate word in the docs 2016-08-04 09:39:32 -04:00
Benjamin Otte c51e97c15e window: Unfreeze window on unmap
Make sure to keep parity with the number of times we froze the window
when we unmap it.
Otherwise it will permanently stay frozen after being remapped.

https://bugzilla.gnome.org/show_bug.cgi?id=766643
https://bugzilla.mozilla.org/show_bug.cgi?id=1225044
2016-08-04 09:39:22 -04:00
Bastian Ilsø 86b8c796cf gtktextview: document how to get line space
adds a paragraph to gtk_text_view_get_pixels_below_lines(),
describing how it can be used together with
gtk_text_view_get_pixels_above_lines() to get the total
amount of line spacing between two paragraphs.

https://bugzilla.gnome.org/show_bug.cgi?id=747206
2016-08-04 09:39:15 -04:00
Matthias Clasen 2669c207bd Add a deprecation note
Mark GtkWidget:style property as deprecated in the docs.
2016-08-04 09:38:01 -04:00
Emmanuele Bassi 6b2a984892 gdk: Provide safe fallback for creating GL contexts
If the backend does not override GdkWindowClass.create_gl_context()
then we should provide a fallback that gives an error, instead of
crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=766782
2016-08-04 09:37:43 -04:00
Emmanuele Bassi f5e192583a gl: Add a realize() fallback
Calling gdk_gl_context_realize() should always result in a valid result,
so we need to provide a default implementation, to avoid a call to a
NULL function pointer.
2016-08-04 09:37:34 -04:00
Ondrej Holy a01ee5a7b0 Improve external drives detection
Use g_drive_is_removable for external drives detection. Current heuristic
fails in some cases (e.g. when removable drive is attached before login),
see Bug 765457.

Bump GLib version accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=765924
2016-08-04 09:36:49 -04:00
Matthias Clasen de595bd1c3 scale: Avoid a crash
gtk_scale_get_layout was not careful enough, leading to a crash
when opening the inspector on a scale.
2016-08-01 09:28:33 -04:00
Carlos Garnacho 5863a41f37 GtkWindow: Ensure the toplevel is realized before realizing popovers
Otherwise those get a NULL parent window, which is toplevel-y enough
to disembody the popover.

https://bugzilla.gnome.org/show_bug.cgi?id=764060
2016-07-30 11:34:04 +02:00
Lapo Calamandrei 9c4ca4ab15 Adwaita: dim calendar uninteresting days some more
see https://bugzilla.gnome.org/show_bug.cgi?id=769003
2016-07-22 14:15:45 +02:00
Lapo Calamandrei 553b332faa Adwaita: clean calendar styling
remove some non working props and generally simplify and clean up
the code, in the process address:

https://bugzilla.gnome.org/show_bug.cgi?id=769003
2016-07-22 14:15:11 +02:00
Owen W. Taylor 26ca5dbc6b 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-07 07:54:16 -04:00
Olivier Fourdan ff99d89f8f 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

(cherry picked from commit 298221bfba)
2016-07-05 15:55:09 +02:00
Andika Triwidada 23673851b7 Updated Indonesian translation 2016-06-26 22:21:22 +00:00
Lapo Calamandrei 8b7091d43c 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:36:01 +02:00
Lapo Calamandrei fbec4164ca 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:35:40 +02:00
Andika Triwidada 3abb9ffa91 Updated Indonesian translation 2016-06-25 03:18:54 +00:00
Misty De Meo d7c1a34bfd configure: fix detecting CUPS 2.x
https://bugzilla.gnome.org/show_bug.cgi?id=767766
2016-06-17 14:47:12 +02:00
Matthias Clasen 9a81e714d6 range: Add a queue_resize call
This is a workaround for a regression in updating scrollbars in
some applications; notably eog. We haven't fully tracked down yet
why a queue_allocation is not sufficient here, it should.
2016-06-06 12:31:41 -04:00
Timm Bäder 3659eb65d0 Scale: Set the correct value alignment
We're measuring both the width of the minimal and the maximal value for
the value gadget, but only give the value the minimal width for its
current value, resultnig in an always left-aligned value.

Fix this by assigning the width of the value gadget to the value layout
and letting pango align the text inside the layout.

https://bugzilla.gnome.org/show_bug.cgi?id=766120
2016-06-01 14:27:54 +02:00
Lapo Calamandrei b1a59daa71 Adwaita: ensure menuitem labels are not overridden
see https://bugzilla.gnome.org/show_bug.cgi?id=767058
2016-05-31 21:01:49 +02:00
Lapo Calamandrei 72ad8b58c5 Adwaita: explicitelly set label caret-color to currentColor
since it doesn't always inherit 'color' color as it should.
2016-05-30 14:23:11 +02:00
Lapo Calamandrei 5c763e97c4 Adwaita: make selection on infobars visible
see https://bugzilla.gnome.org/show_bug.cgi?id=745622
2016-05-30 14:02:36 +02:00
Lapo Calamandrei 6e56aaffe3 Adwaita: remove textview border
see https://bugzilla.gnome.org/show_bug.cgi?id=764203
2016-05-27 11:34:47 +02:00
Kjartan Maraas ab598631af Updated Norwegian bokmål translation. 2016-05-23 18:56:02 +02:00
Matthias Clasen bbf775301a 3.20.6 2016-05-23 07:59:21 -04:00
Florian Müllner 458c0b9525 stack: Only map children when necessary
gtk_widget_set_parent() will map the widget if the parent is mapped
and the widget is both visible and child-visible. As we currently
only set the child visibility after adding the child, we immediately
map all children that are added to a mapped stack, even when they
are not actually shown. Avoid this by setting the child visibility
before adding the child, so widgets are only mapped when shown.

https://bugzilla.gnome.org/show_bug.cgi?id=766737
2016-05-23 07:58:42 -04:00
Matthias Clasen a2d723c133 treeview: Fix a rubberbanding-related crash
When starting a rubberband selection from an empty area, we could run
into crashes if the selection moves over the rows and then back out
to unpopulated area. Handle this case without crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=766336
2016-05-23 07:58:42 -04:00
Carlos Garnacho 3270bdb981 popover: set priv->window before setting doing add_popover() on it
If the popover's relative-to widget is unparented/reparented, we end
up unparenting/reparenting the popover as well. In that case, at the
moment of reparenting, the widget might have been visible (and is
thus mapped again), but priv->window hasn't been set yet.

We must first set priv->window, and then call gtk_window_add_popover(),
that way gtk_popover_map() has its prerequisites straight.

https://bugzilla.gnome.org/show_bug.cgi?id=766323
2016-05-21 20:41:54 +02:00
Khaled Hosny 924c6a679b Update Arabic translation 2016-05-21 15:50:26 +02:00
Lapo Calamandrei f62505a77f Adwaita: add vertical margins to switches on a headerbar
See https://bugzilla.gnome.org/show_bug.cgi?id=766642
2016-05-20 15:42:22 +02:00
Lapo Calamandrei 375a1282f4 Adwaita: shave 1px from the switch
make the switch height and width 1px smaller.
2016-05-20 15:41:25 +02:00
Matthias Clasen ca8d51e6d0 Revert "scrolledwindow: Remove child before destroying self"
This reverts commit dcb4b48b29.

This was causing crashes in the filechooser in some applications.

https://bugzilla.gnome.org/show_bug.cgi?id=766694
2016-05-20 09:23:51 -04:00
Ignacio Casal Quinteiro cdb3271346 gtktextview: fix < public > comment
This was causing problems with the gtk# scanner
2016-05-20 09:09:10 +02:00
Matthias Clasen 1e419a94b5 3.20.5 2016-05-19 12:43:00 -04:00
Matthias Clasen ff14bb504b Updates 2016-05-19 12:37:54 -04:00
Matthias Clasen 00d1f73204 gtk-demo: Fix revealer demo
This only used by luck before. We are changing a property from the
::notify handler for that property. Now that GtkRevealer is notifying
the property when it stops animations on unmap, we end up in a life
lock situation where we never make it out of the notify queue.

Fix this by not restarting the animation if the widget is unmapped.
2016-05-19 12:37:54 -04:00
Matthias Clasen 9a60a3659f scale css node test: Adapt to changes
The style classes are reflected in the output here.
2016-05-19 12:27:08 -04:00
Matthias Clasen fcbb6b7fe3 wayland: Survive lack of settings
This can be made to happen eg by setting XDG_DATA_DIRS and
XDG_DATA_HOME to /. Not a useful value, but not a good reason
to crash either.
2016-05-19 12:10:07 -04:00
Matthew Waters 246385a8e7 gdk/wayland: use the multi-thread safe wayland API
This is required for proper integration with any other library/application that
may perform wayland API calls and poll() the wayland fd from multiple threads.
Using wl_display_dispatch{_queue}() is thread-safe if not mixed with custom
poll() usage, which GSource/GMainContext does.

Essentially, the problem is that multiple threads polling and reading
the same fd is extremely racy.  Use the wayland provided API for allowing
concurrent access to the wayland display fd.

See the wayland man pages for wl_display_prepare_read(),
wl_display_cancel_read() and wl_display_read_events() for more details.

https://bugzilla.gnome.org/show_bug.cgi?id=763852
2016-05-19 12:10:07 -04:00
Debarshi Ray 1e2bde6971 scrolledwindow: Fix typo in get_preferred_height calculation
When we are beginning to calculate the height, if the vscrollbar_policy
is not GTK_POLICY_NEVER, and there is no min-content-height, then we
need some small non-zero value to get started. The idea is to always
ask for at least enough to fit the horizontal scrollbar.

Simply put, this should be the mirror image of the corresponding width
calculation code.

Those who got used to the buggy behaviour might notice that their
GtkScrolledWindows are not as tall as they used to be.

Fall out from 55196a705f

https://bugzilla.gnome.org/show_bug.cgi?id=766530
2016-05-19 12:10:07 -04:00
Matthias Clasen 7d2f54f0f3 icon theme: Add a warning
Warn about the situation when we've found a resource or file path,
but gdk-pixbuf fails to give us a pixbuf. This generally means that
either pixbuf loaders are not found or the shared-mime database
is missing.
2016-05-19 12:10:07 -04:00
Timm Bäder 706b3ffc82 stack: Don't underallocate the last_child 2016-05-19 12:10:07 -04:00
Timm Bäder f5b76a1f56 stack: Remove some code duplication 2016-05-19 12:10:07 -04:00
Matthias Clasen 8601c0eccd places sidebar: Avoid markup confusion in tooltips
At one point, the sidebar was using gtk_treeview_set_tooltip_column,
which expects tooltips to be markup. With the listbox-based sidebar,
we don't do that anymore. So don't escape the tooltip text.

https://bugzilla.gnome.org/show_bug.cgi?id=766175
2016-05-19 12:10:07 -04:00
Matthias Clasen 8e2cf127e6 x11: Trap possible X error
XIGetClientPointer can generate X errors (e.g. when the X server
does not support XI2. Trap them and carry on.

https://bugzilla.gnome.org/show_bug.cgi?id=766233
2016-05-19 12:10:07 -04:00
Timm Bäder 077e1999b3 scale: Remove double nullable annotation
Being both (allow-none) and (nullable) at the same time is a bit much.
Was from 591e7f5ef8.
2016-05-19 12:10:07 -04:00
Timm Bäder 5fb18692e0 widget: Add Since annotation to gtk_widget_queue_allocate 2016-05-19 12:10:07 -04:00
Benjamin Otte dcb4b48b29 scrolledwindow: Remove child before destroying self
Children tend to call back into the scrolled window while being removed
and that doesn't work too well if the scrolled window is destroyed
already as Christian Hergert found out.
2016-05-19 12:10:07 -04:00
Benjamin Otte e7e55d13a4 cssimage: Make it possible to shrink builtin check/optionmarks
... below 7px of size.
2016-05-19 12:10:07 -04:00
Matthias Clasen adcbd8add9 gtk3-demo: Add a close button to the markup window 2016-05-19 12:10:07 -04:00
Matthias Clasen 13a14d071a gtk-demo: Don't duplicate text in markup example
I forgot to clear the buffer before inserting the new markup. Oops.
2016-05-19 12:10:07 -04:00
Matthieu Gautier 2cb24c7975 revealer: emit notify::child-revealed when animation stops
Depending of float rounding during target calculation, the size of the
GtkRevealer can be set to zero will the animation is not finished.
If the GtkRevealer is in a GtkPaned, it will be hidden and so the animation
will be stopped before it is finished.

In this case, force the emission of the child-revealed signal to let
client code know the animation is finished.

https://bugzilla.gnome.org/show_bug.cgi?id=765973
2016-05-19 12:10:07 -04:00
Timm Bäder 0377a8c408 infobar: Fix typo
Style class names are prefixed with a '.'
2016-05-19 12:10:07 -04:00
Lapo Calamandrei 101c06da53 Adwaita: fix scale theming
rely on toplevel styleclass for scale with marks.

See https://bugzilla.gnome.org/show_bug.cgi?id=766440
2016-05-19 17:27:00 +02:00
Lapo Calamandrei fb3e626400 color scale: Really sync style classes with GtkScale
sync the alpha scale styleclass too.
2016-05-19 17:24:51 +02:00
Matthias Clasen 6170149393 color scale: Sync style classes with GtkScale
We should use the same style classes here, to avoid theme
confusion.
2016-05-19 11:06:51 -04:00
Ignacio Casal Quinteiro ee841a282b gtkselectionprivate: minor style fix
This seems to make some issue with the gtk# scanner.
2016-05-19 16:57:55 +02:00
Matthias Clasen 1fde631031 scale: Use more succinct names for style classes
Use .marks-before/after to indicate the presence of marks.
As Lapo points out, compatibility with the previous names
is not really that important, since everything else changed
around it.

https://bugzilla.gnome.org/show_bug.cgi?id=766440
2016-05-19 09:50:23 -04:00
Matthias Clasen e441c17a0a scale: Bring back marks-related style classes
It turns out that it is too hard (and in some cases, impossible)
to get this information from node positioning, so bring back the
.scale-has-marks-above/below style classes on the main node.

This should allow us to fix the 'pointy sliders'.

https://bugzilla.gnome.org/show_bug.cgi?id=766440
2016-05-18 13:02:11 -04:00
Carlos Garnacho aec4dbfa94 x11/dnd: Ignore grab broken events from other devices than our DnD device.
The GdkDragContext should only listen to GDK_GRAB_BROKEN events sent to
its own pointer device. It turns out that the passive key grabs mistake
GDK into sending a GdkEventGrabBroken on the master keyboard, which the
DnD machinery mistakes as a signal to cancel the operation.

https://bugzilla.gnome.org/show_bug.cgi?id=766442
2016-05-18 13:09:55 +02:00
Baurzhan Muftakhidinov d1585a7a60 Updated Kazakh translation 2016-05-17 10:18:52 +00:00
Matthias Clasen b893b62d7a Docs: Clarify life cycle issue
gtk_gesture_get_last_event() wasn't very clear about how long
it is safe to use the returned pointer.

(cherry picked from commit c891ceb31d)
2016-05-17 10:30:56 +02:00
Matthias Clasen e006f3ca98 DND: Avoid a use-after-free
Cancelling the gesture causes the last_event pointer to become
invalid. Make a copy of the event so we can keep using it
regardless of the gesture state.

(cherry picked from commit 358eec2972)
2016-05-17 10:30:44 +02:00
Tiago Santos 4424bf8135 Updated Portuguese translation 2016-05-15 21:42:16 +00:00
Tiago Santos 818266a805 Updated Portuguese translation 2016-05-15 21:25:26 +00:00
Chun-wei Fan 1994f37481 Visual Studio builds: Refine "installation" process
Split out the part where we generate/update the caches for the GSchemas
and the icons, so that it is easier to ensure that things continue to
function correctly when we have GlibEtcInstallRoot != CopyDir.
2016-05-10 13:33:40 +08:00
Matthias Clasen 13f45bd4cd 3.20.4 2016-05-09 14:33:41 -04:00
Matthias Clasen 1b07cf6522 Update css node tests for removal of .slider from GtkSwitch 2016-05-09 14:33:41 -04:00
Emmanuele Bassi 1e7ded6a47 docs: Update examples of matching key bindings
The selector for matching GtkEntry has changed to `entry` after 3.20.

https://bugzilla.gnome.org/show_bug.cgi?id=766166
2016-05-09 12:46:35 +01:00
Rafael Fontenelle 207b793316 Updated Brazilian Portuguese translation 2016-05-08 14:25:31 +00:00
Lapo Calamandrei 4ece50a13c Adwaita: relocate a selector
relocate treview acceleditor > label in the treeview section and
add a comment for a testcase.
2016-05-06 18:50:37 +02:00
Lapo Calamandrei 659329c168 Adwaita: tidy treeview style properties...
...removing a double definition in the process.
2016-05-06 15:42:07 +02:00
Matthias Clasen 162e41633d scale: Fix mark positioning at the left/top edge
We were failing to take the widget allocation.x/y into account
when deciding whether we need to push in the mark.

https://bugzilla.gnome.org/show_bug.cgi?id=765922
2016-05-05 15:19:15 -04:00
Carlos Garnacho 6f2187270e x11: Rely on passive keyboard grabs with XI2 for DnD
The active keyboard grab can be spared then. This way the passive
key grabs allow other key combinations (eg. alt-tab) that are not
mandatory to grab here.
2016-05-05 15:04:02 -04:00
Carlos Garnacho c509a104b7 searchenginetracker: Quote fts match so it's seen as a single phrase
FTS5 has a complex enough syntax that it makes not much sense to wrap
in simple search boxes.

https://bugzilla.gnome.org/show_bug.cgi?id=765981
2016-05-05 15:04:02 -04:00
Matthias Clasen 08e508889f css names are always set
No need to check for it, we set the css name on GtkWidgetClass
ourselves.
2016-05-05 15:04:02 -04:00
Timm Bäder e9713145f9 switch: Remove .slider from slider gadget
As the documentation states, neither the switch nor the slider gadget
should be using any style classes.
2016-05-05 15:04:02 -04:00
Timm Bäder f203f7ccc0 switch: Create less pango layouts
Instead of creating 2 pango layouts in every draw() and on in
_get_content_size (and calling into gettext twice in both cases), just
keep the layouts around and create them in only one place.
2016-05-05 15:04:02 -04:00
Timm Bäder b9926f65a3 label: Also initialize text
So gtk_label_get_text returns the default value of "". Broke the
GtkModelButton default value test.
2016-05-05 15:04:02 -04:00
Timm Bäder efcfa0ec94 label: don't use set_text in gtk_label_new
It would just set up lots of things with the default values, but a
common case is that a few gtk_label_set_* calls follow.
2016-05-05 15:04:02 -04:00
Timm Bäder 200ed52e92 label: minimum/natural size parameters are not nullable
Stop comparing them to NULL.
2016-05-05 15:04:02 -04:00
Timm Bäder 304e2d5711 label: Don't set out parameters twice
We set them later again when we calculate the vertical size, so just
move the general assignment to -1 into the horizontal branch.
2016-05-05 15:04:02 -04:00
Timm Bäder 0a3122b541 widget: Remove useless NULL check
We are checking for allocation != NULL at the beginning of the function
already. This also means that the allocation parameter is not nullable.
2016-05-05 15:04:01 -04:00
Benjamin Otte 1bac6684f1 cssimagebuiltin: Remove icons that don't draw anything anymore 2016-05-05 15:04:01 -04:00
Benjamin Otte 9d1a64455b cssimagebuiltin: Remove unused variables 2016-05-05 15:04:01 -04:00
Matthias Clasen c46bfcf752 css: Stop drawing double borders for builtins
The fallback code for rendering builtin checks, radios
and expanders was using border parameters. With the generic
gadget borders using the same parameters, this was giving
double borders.
2016-05-05 15:04:01 -04:00
Timm Bäder bab6cb6d97 shadowsvalue: Don't draw invisible box shadows 2016-05-05 15:04:01 -04:00
Matthias Clasen f58aaf2ccf Fix gtk_paned_set_position to set position_set consistently
As pointed out in https://bugzilla.gnome.org/show_bug.cgi?id=765676,
we were failing to set position_set if the position did not change.
2016-05-05 15:04:01 -04:00
Руслан Ижбулатов 86855f7531 GtkPlacesView: check for network:// URI support before using it
Specifically, this URI is not supported on Windows, but GFile will
do its "best" and turn it into GLocalFile("$pwd/network"), with
spectacularly bad results.

https://bugzilla.gnome.org/show_bug.cgi?id=765858
2016-05-05 15:04:01 -04:00
Carlos Garnacho 25672b7f39 gdkevents: Free motion events discarded by motion compression
Those should be freed together with their list link.
2016-05-05 15:04:01 -04:00
Matthias Clasen 1065506257 dnd: Make sure to free a stashed event
I am not sure if this happens in practice, but better to be safe.
2016-05-05 15:04:01 -04:00
Matthias Clasen e3e84de96c gesture: Don't leak stashed events
These events were never freed.
2016-05-05 15:04:01 -04:00
Matthias Clasen 964eb99a5e Drop unused macros
These have been sitting here forever, unused. Time to drop them
2016-05-05 15:04:01 -04:00
Matthias Clasen 518023df56 x11: drop a useless list
We were keeping all the event sources in a list, only to remove
them at the end of their life. Not useful.
2016-05-05 15:04:01 -04:00
Matthias Clasen 86f197893a wayland: drop a useless list
We were keeping all the event sources in a list, only to remove
them at the end of their life. Not useful.
2016-05-05 15:04:01 -04:00
Matthias Clasen ac26fc3be4 wayland: Tag the event source with the acutal display name 2016-05-05 15:04:00 -04:00
Matthias Clasen 4ad8436316 wayland: Make gdk_display_get_name work
It should just return the same as gdk_screen_make_display_name.
2016-05-05 15:04:00 -04:00
Matthias Clasen 631123bbd4 Use a better hash for arcs 2016-05-05 15:04:00 -04:00
Matthias Clasen 5f9a19ff33 box gadget: Redo expand flag handling
We only keep one align flag per child, so it seems odd to
keep separate h/v expand flags. Just keep one expand flag
and interpret it according to orientation. Allow setting
the expand flag for child widgets too, though, so we can
make widget expand without interfering with the recursive
widget expand flag.

Update all callers.

Use the new possibility of expanding child widgets to make
the label of check and radio buttons expand. This fixes
unexpected behavior of these widgets in RTL in some places.

https://bugzilla.gnome.org/show_bug.cgi?id=765742
2016-05-05 15:04:00 -04:00
Matthias Clasen 587308004c expander: Reverse alignments in RTL
Flip alignments of the title gadget children.
2016-05-05 15:04:00 -04:00
Matthias Clasen 2ebad7ec2b check button: Reverse alignments in RTL
Flip alignments for the box gadget children.
2016-05-05 15:04:00 -04:00
Matthias Clasen fc04d6613a box gadget: allow reversing alignments
In RTL, we want to interpret GTK_ALIGN_START and _END
in the opposite way. Since we don't give gadgets a text
direction, just allow setting an align_reverse flag
to the box gadget.
2016-05-05 15:04:00 -04:00
Руслан Ижбулатов 515c665b7f GtkTreeView: change child repositioning to preserve locality
If there was a piece of text in the cell, then when the edit
entry is shown for that cell, it should have a piece of text
in it roughly at the same location.

Therefore, when child widget is enlarged (child preferred
size exceeds cell size), extra width should be added by
extending either left or right edge depending on text direction.

If after that the child sticks outside of the treeivew visible region,
try to push it back inside (breaking its alignment with the
cell), again, giving preference (i.e. adjusting it last)
to either left or right edge depending on text direction.

https://bugzilla.gnome.org/show_bug.cgi?id=765471
2016-05-05 15:04:00 -04:00
Lapo Calamandrei 563add1325 Adwaita: add a background to cellrendertext 2016-05-05 15:04:00 -04:00
Daniel Stone 0e44b8c38c wayland: Ignore NoSymbol keys
NoSymbol is not a valid GDK symbol (it only has the concept of
VoidSymbol, for some reason, which is neither the same thing nor
produced by any sane keymap). Passing NoSymbol events through to GTK+
apps is unlikely to produce anything useful.

In particular, this meant VTE would scroll to the end of the buffer when
pressing Fn (required for Page Up/Down on Macs), as it was receiving a
keypress that wasn't a modifeir. This does not happen on X11, as the
KEY_FN keycode is above 255, so does not get sent to clients.

https://bugzilla.gnome.org/show_bug.cgi?id=764825
2016-05-05 15:04:00 -04:00
Christian Hergert cdab14dc22 pixelcache: reuse existing timeout source when possible
This avoids the g_source_remove(), g_source_destroy(),
g_timer_source_new(), and g_source_set_name_by_id() in the common case.

Instead, we reuse our previous source and update the ready time to our
new deadline. We lose the coalescing with g_timeout_add_seconds(), but
that is not going to help in the common case anyway (unless you have
three hands and can scroll multiple pixelcached backed widgets at once).

https://bugzilla.gnome.org/show_bug.cgi?id=765640
2016-05-05 15:04:00 -04:00
Matthias Clasen ab300e7de3 dnd: Fix some issues with drag icons
In non-composited environments, we were ending up with all-black
drag icons, because nothing was drawing the background of our new
toplevel. Fix this by drawing background when we are not composited.
We don't do this when composited, since we want to allow transparent
icons.
2016-05-05 15:03:59 -04:00
Matthias Clasen acdb9650e2 dnd: Set attributes from all widgets for text drag icons
There is nothing textview-specific here.
2016-05-05 15:03:59 -04:00
Matthias Clasen 92166f1f69 progressbar: Enforce invariants
When measuring gadgets, minimum must come out <= natural.
Make sure we don't fail this when measuring progressbar text.

https://bugzilla.gnome.org/show_bug.cgi?id=765644
2016-05-05 15:03:59 -04:00
Matthias Clasen 7054b0ccff dnd: Fix lifecycle issues with widgets as drag icons
The documentation clearly says that the widget is not destroyed,
but we were in fact failing to keep it alive, since it was still
a child or the icon_window when we destroy that. Fix this by
reparenting the icon_widget out before. Also, deal with the
possibility that the application might destroy the widget
halfway through, for whatever reason.
2016-05-05 15:03:59 -04:00
Matthias Clasen ea0d3d2a95 testdnd2: Actually test gtk_drag_set_icon_widget
I added a new test function, but didn't actually use it.
No wonder I couldn't reproduce the lifecycle issues with
drag widgets that firefox is experiencing.
2016-05-05 15:03:59 -04:00
Jonas Ådahl 0258c88949 gdk/dnd: Don't use default display when getting cursor
Always associate a drag context with a GdkDisplay and use that when
getting a cursor for a given action.

If we don't do this, dragging on a window that doesn't use the default
display will make us use cursors from the wrong display.

https://bugzilla.gnome.org/show_bug.cgi?id=765565
2016-05-05 15:03:59 -04:00
Christian Hergert 3244d7a138 frametimings: reuse previous frame timing in common case
Typically, there won't be any references on old frame timings except for
the most recent timing. So instead of discarding these and re-entering
gslice twice, just steal the old frame timing and reuse it.

https://bugzilla.gnome.org/show_bug.cgi?id=765592
2016-05-05 15:03:59 -04:00
Jonas Ådahl 044e4b15a6 wayland: Track orphaned dialogs per display
Don't track all orphaned dialogs globally, as mixing them up with each
other would in most cases trigger errors when we try to pass bogus
values to Wayland requests.

https://bugzilla.gnome.org/show_bug.cgi?id=765474
2016-05-05 15:03:59 -04:00
Matthias Clasen f6a5dad12c Expand the drag widget testcase
This adds a testcase which reuses the drag widget for multiple
drags.
2016-05-05 15:03:59 -04:00
Matthias Clasen b38e4e0ac0 notify test: Skip GtkFontButton::font-name
This is not freely settable.
2016-05-05 15:03:59 -04:00
Matthias Clasen 4b4533ef68 font button: Fix translation of font-name default
The default value should come out of regular translations, not
property translations.
2016-05-05 15:03:59 -04:00
Christian Hergert 113ce66151 wayland: avoid jitter in keyboard repeat
When synthesizing keyboard repeat, we can potentially drift further from
the mark depending on the timing of the frame callback and how long it
took to deliver the event.

This patch attempts to reduce this by tracking from a stable epoch the
time of our next keyboard repeat.

https://bugzilla.gnome.org/show_bug.cgi?id=765567
2016-05-05 15:03:59 -04:00
Timm Bäder 021d065a1f GtkLabel: Use g_clear_object
https://bugzilla.gnome.org/show_bug.cgi?id=765496
2016-05-05 15:03:58 -04:00
Timm Bäder db17324d82 GtkLabel: Don't manually iterate over link list
There are various functions to access links based on their index for
a11y. We can spare quite a few lines of code by just using
g_list_nth_data instead of iterating over the list ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=765496
2016-05-05 15:03:58 -04:00
Christian Hergert d505df90b0 builtinicon: avoid calculating font-metrics in vast majority of cases
We perform lots of gadget allocations that require allocating a
GtkBuiltinIcon. One notable example is the scrollbar for a scrolled
window.

In the process of doing this, we often calculate baseline information that
isn't necessary. With how much this code path gets exercised, its worth
catching the result for the common case, which is that the font-description
has not changed and we are using the default language the application
was started with.

This simply caches the previous result and verifies that we can reuse it
with pango_font_description_hash() and a simple language check.

Numbers below are scrolling through a textview with GDK_KEY_Down.

Before:
      SELF CUMULATIVE    FUNCTION
[   0.08%] [   9.26%]    gtk_builtin_icon_get_preferred_size
[   0.01%] [   8.82%]      pango_context_get_metrics
[   0.02%] [   0.16%]      gtk_widget_get_pango_context
[   0.06%] [   0.06%]      pango_context_get_language
[   0.01%] [   0.02%]      g_type_check_instance_cast
[   0.02%] [   0.02%]      strlen
[   0.02%] [   0.02%]      pango_context_get_font_description
[   0.02%] [   0.02%]      g_list_foreach
[   0.01%] [   0.01%]      gtk_css_style_get_value
[   0.01%] [   0.01%]      itemize_with_font
[   0.01%] [   0.01%]      pango_context_get_type
[   0.01%] [   0.01%]      get_base_metrics
[   0.00%] [   0.01%]      pango_font_metrics_unref
[   0.01%] [   0.01%]      g_list_free
[   0.01%] [   0.01%]      gtk_builtin_icon_get_type

After:
      SELF CUMULATIVE    FUNCTION
[   0.08%] [   0.18%]    gtk_builtin_icon_get_preferred_size
[   0.02%] [   0.02%]      pango_font_description_hash
[   0.00%] [   0.02%]      gtk_widget_get_pango_context
[   0.00%] [   0.02%]        g_object_get_qdata
[   0.00%] [   0.02%]          g_datalist_id_get_data
[   0.02%] [   0.02%]      gtk_builtin_icon_get_type
[   0.01%] [   0.01%]      pango_context_get_font_description
[   0.00%] [   0.01%]      - - kernel - -
[   0.01%] [   0.01%]      pango_context_get_language
[   0.00%] [   0.01%]      gtk_css_style_get_value
[   0.00%] [   0.01%]      gtk_css_gadget_get_style

https://bugzilla.gnome.org/show_bug.cgi?id=765486
2016-05-05 15:03:58 -04:00
Paolo Borelli db326889f9 inspector: do not leak seat capabilities descriprion
Factor out an utility function for readability and free the string
with the list of capabilities
2016-05-05 15:03:58 -04:00
Christian Hergert 6be0f108b4 kineticscrolling: avoid stutter at tail of kinetic deceleration
When decelerating the kinetic scroll, we can get into a position where it
looks like we are stuttering. This happens because the amount we move is
so little that it takes multiple frames to make forward progress by one
pixel.

This prevents that by detecting when we have reached the slow stutter of
the deceleration and simply stops the deceleration phase immediately.

https://bugzilla.gnome.org/show_bug.cgi?id=765493
2016-05-05 15:03:58 -04:00
Paolo Borelli 136409b8cd textiter: add unit test for forward_to_line_end
Surprisingly we had no unit test for this method
2016-05-05 15:03:58 -04:00
Matthias Clasen 84e0bef150 Fix formatting
The previous change was not quite using the right coding style.
2016-05-05 15:03:58 -04:00
Timm Bäder 0e002cbef0 listbox: Make sure page down/up move at least one row
When the current cursor_row is taller than the page_size we get from the
GtkAdjustment, the previous code would not actually cause any scrolling,
so make sure we just take the row after or before the cursor_row in that
case.

https://bugzilla.gnome.org/show_bug.cgi?id=765261
2016-05-05 15:03:58 -04:00
Benjamin Otte 107b5d7397 cssshadowsvalue: Avoid allocating new value if not needed 2016-05-05 15:03:58 -04:00
Benjamin Otte 8efd10c9fd cssbordervalue: Avoid allocating new value if not needed 2016-05-05 15:03:58 -04:00
Benjamin Otte 758e10ad41 cssbgsizevalue: Avoid allocating new value if not needed 2016-05-05 15:03:58 -04:00
Matthias Clasen 5d5b7c9f7f Add a dnd test using a window as icon
This case is causing problems in firefox. Lets at least make
sure that it doesn't crash in GTK+.
2016-05-05 15:03:58 -04:00
Jonathan Matthew 761f19e7d7 gtkmenusectionbox: remove submenus when the parent item is removed
https://bugzilla.gnome.org/show_bug.cgi?id=749405
2016-05-05 15:03:58 -04:00
Matthias Clasen c33d8c7005 widget: Don't show widget resizes in the inspector
Avoiding this sort of visual debugging in the inspector
is the main reason we have per-display debug flags now.
2016-05-05 15:03:57 -04:00
Matthias Clasen 4cf6141462 css gadget: Fix baseline debug
We were not using the baseline that we're computing.
2016-05-05 15:03:57 -04:00
Matthias Clasen 3376093058 Use qdata for debug flags
This avoids some overhead.
2016-05-05 15:03:57 -04:00
Matthias Clasen 11e8573d0e css gadget: Don't get display flags twice
This got more expensive now that we store them per-display,
so don't get them twice in the same function.
2016-05-05 15:03:57 -04:00
Christian Hergert 8653bb8122 debug: remove open-coded debug checks in gtktextsegment
These runtime checks were being performed whether or not we were in a
debug build. Using GTK_DEBUG_CHECK() will compile out of production
builds, as it will result in something like:

  if (G_UNLIKELY(0))

which the optimizer can prune.

https://bugzilla.gnome.org/show_bug.cgi?id=765284
2016-05-05 15:03:57 -04:00
Matthias Clasen 9e2d5b9064 Add some va marshallers to frequent signals
This makes us take the fast path in signal emission.
2016-05-05 15:03:57 -04:00
Matthias Clasen bdda7d1fa8 magnifier: Only connect to ::draw when needed
This making us take the slow path in ::draw handling, so we
want to avoid it if we can.

https://bugzilla.gnome.org/show_bug.cgi?id=765238
2016-05-05 15:03:57 -04:00
Lapo Calamandrei 7dbe3d953d Adwaita: more flexible headerbar_fill mixin
adding an additional background layer as a parameter.
2016-05-05 18:07:55 +02:00
Kjartan Maraas 80a93be9e6 Updated Norwegian bokmål translation. 2016-05-03 23:22:42 +02:00
Olivier Fourdan a537bdc1fe wayland: fix up/down mix up in discrete events
The wayland specification for discrete step information for scroll and
other axes reads:

| The discrete value carries the directional information. e.g. a
| value of -2 is two steps towards the negative direction of this axis.

mutter sets a value of 1 for SCROLL_DOWN events and -1 for SCROLL_UP
events.

gdkdevice Wayland backend does the opposite, it translates a positive
discrete value as SCROLL_UP and a negative value as SCROLL_DOWN, which
ends up inverting the scrolling direction.

Fix the logic in gdkdevice Wayland to use a positive value as
SCROLL_DOWN and a negative value as SCROLL_UP so that it matches mutter
and weston logic.

https://bugzilla.gnome.org/show_bug.cgi?id=765907
2016-05-03 10:50:50 +02:00
Carlos Soriano 848dd947ca testnotebookdnd: add one GtkListBox as tab content
To make sure we test regressions on widgets that bubble up motion
handling and can trigger the motion handling code path on GtkNotebook.

https://bugzilla.gnome.org/show_bug.cgi?id=764395
2016-05-02 13:21:41 +02:00
Carlos Soriano d6187a3dc4 gtknotebook: avoid tab dnd from content
Before commit 6c1bee2377 we were setting an attribute of GtkNotebook
to track the pressed button if the pressed button happened on the
tab itself.
Later in the motion handling code we were checking whether the private
pressed button attribute was set or not in order to handle a tab dnd
or not.

In commit 6c1bee2377 the code changed and set the pressed button
variable unconditionally, which means, a motion event from within the
tab content triggered a tab reordering.

This happened only if the children hierarchy have a widget that bubbles
up both button press event, which sets the private pressed button
attribute; and motion events, which started the tab dnd checking the
private pressed button attribute.
A widget that experienced the regression was GtkListBox.

In order to fix it, set the button pressed variable only when it press
the tab itself, not the content.

https://bugzilla.gnome.org/show_bug.cgi?id=764395
2016-05-02 13:21:34 +02:00
Руслан Ижбулатов 96e1d7bfac W32: reword the error about required cairo version
1.14.x series does not contain the functionality needed by GTK+.
Advise to use 1.15.x (1.15.2 is available) or 1.16.x (yet to be released).

https://bugzilla.gnome.org/show_bug.cgi?id=765790
2016-04-29 07:07:29 +00:00
Lapo Calamandrei 0f28c2cd47 Adwaita: refactor levelbar styling. 2016-04-28 15:56:14 +02:00
Daniel Stone 8f9693e02c wayland: Ignore NoSymbol keys
NoSymbol is not a valid GDK symbol (it only has the concept of
VoidSymbol, for some reason, which is neither the same thing nor
produced by any sane keymap). Passing NoSymbol events through to GTK+
apps is unlikely to produce anything useful.

In particular, this meant VTE would scroll to the end of the buffer when
pressing Fn (required for Page Up/Down on Macs), as it was receiving a
keypress that wasn't a modifeir. This does not happen on X11, as the
KEY_FN keycode is above 255, so does not get sent to clients.

https://bugzilla.gnome.org/show_bug.cgi?id=764825
2016-04-27 14:08:11 +01:00
Carlos Garnacho 7dac519277 wayland: Perform seat grab focus checks on native windows
We don't care about the specific (possibly client-side) window that
requested the focus here, only the toplevel. Fixes mistakenly sent
focus events when the grab happens inside the current focus window.

https://bugzilla.gnome.org/show_bug.cgi?id=762756
2016-04-27 13:34:27 +02:00
Rūdolfs Mazurs d0ad84c2a3 Update Latvian translation 2016-04-24 16:18:45 +03:00
Rui Matos 60ba261ed6 wayland: Leave existing mods on map_virtual_modifiers
map_virtual_modifiers() is supposed to add the necessary virtual mods
but otherwise leave the mods that are passed in.

https://bugzilla.gnome.org/show_bug.cgi?id=765270
2016-04-19 21:13:45 +02:00
Timm Bäder ddde1a58a8 gtkcssimagebuiltin: Save/restore around cairo_clip
This was previously causing trouble in checkbuttons where the check node
didn't have an icon shadow set, e.g. in Raleigh.
2016-04-19 10:40:14 -04:00
Christian Hergert 373749649e frame-clock: avoid g_signal_emit_by_name()
These were showing up higher in Sysprof profiles.

The simple fix is to avoid the emit_by_name() and let the interface emit
the signals directly. No function preconditions are provided since these
are internal API.
2016-04-19 10:39:56 -04:00
Carlos Garnacho 9187677a78 wayland: Improve checks when flushing scroll events
If we get gdk_wayland_seat_flush_frame_event() with no previous event to be
flushed, we fallback into the scroll event checks. However, there's no check
performed there as to whether it really scrolled, so it'd always send a smooth
scroll event with 0/0 deltas in this case.

This should be mostly harmless, but still, we should only end up emitting scroll
events if those really happened.
2016-04-19 10:39:20 -04:00
Carlos Garnacho b6402da864 wayland: Do not check the pointer focus when receiving wl_pointer.frame
The frame event is also meant to compress wl_pointer.leave events, at this
point the focus surface will be definitely NULL. In the end, wl_pointer.frame
should flush the last composed event despite the pointer focus.

https://bugzilla.gnome.org/show_bug.cgi?id=765065
2016-04-19 10:39:04 -04:00
Carlos Garnacho 32397f0b72 gdk: Make GDK_TOUCH_CANCEL be dealt with similarly to GDK_TOUCH_END
We must emit the cancel event with the same semantics, and towards the GdkWindow
that is currently under the touchpoint, so make proxy_button_event() deal with
GDK_TOUCH_CANCEL.

Fixes the GDK_TOUCH_CANCEL event being emitted only on the toplevel, which is
usually non-sufficient.
2016-04-19 10:37:34 -04:00
Matthias Clasen 6e00717079 menuitem: Fix some possible problems with arrow_gadget
https://bugzilla.gnome.org/show_bug.cgi?id=765134 shows
a stacktrace where we end up with arrow_gadget being NULL
despite the conditions for its presence being satisfied.

This commit makes sure we call update_arrow_gadget() whenever
any of the conditions changes. This should fix the reported
crash.
2016-04-19 10:36:23 -04:00
Matthias Clasen e8863ece18 Add some more accelerator / modifier tests 2016-04-19 10:36:14 -04:00
Matthias Clasen 0100f08592 wayland: Make virtual modifier mapping more similar to X
Ignore virtual modifiers that are mapped to Mod1 (as Meta
often is), to avoid interfering with our fix interpretation
of Mod1 as Alt.
2016-04-19 10:36:14 -04:00
Matthias Clasen 49bddf48ad wayland: Fix the map_virtual_modifiers implementation
We were not stripping real modifiers out, and thus always
thought there's a conflict when the passed in modifiers
included any real modifiers.
2016-04-19 10:36:14 -04:00
Matthias Clasen 4018a32e0b wayland: Implement virtual modifiers
Since Wayland is using libxkbcommon, it inherits X unfortunate
real/virtual modifier distinction, so we have to do the same
gymnastics we do for X to map between the two.

This should fix matching of accelerators using virtual modifiers
(modulo gnome-shell bugs regarding the handling of Super).

https://bugzilla.gnome.org/show_bug.cgi?id=764424
2016-04-19 10:36:14 -04:00
Matthias Clasen e530a0ecd1 Clarify docs a bit
The wording here was just awkward: TRUE is returned if... Note that
FALSE is also returned if...
2016-04-19 10:36:14 -04:00
Emmanuele Bassi 5e11b071a7 recent-manager: Emit ::changed on file deletion
This will clear out the list of recently used files, and will allow GVFS
to handle this case.

https://bugzilla.gnome.org/show_bug.cgi?id=693077
2016-04-19 10:30:59 -04:00
Emmanuele Bassi 1c449e8d4a Assign a recent manager if one is set
The GtkRecentAction implementation ignored a GtkRecentManager passed to
its :manager property.

https://bugzilla.gnome.org/show_bug.cgi?id=620065
2016-04-19 10:30:59 -04:00
Sébastien Wilmet 6144469d02 app: minor code improvements
- use GDK_EVENT_PROPAGATE
- pass better zero-values to gtk_init(), since the parameters are
  pointers.

https://bugzilla.gnome.org/show_bug.cgi?id=764846
2016-04-19 10:28:58 -04:00
Sébastien Wilmet a2a3de7861 app: improve code of extract_accels_from_menu()
sub_model is clearer than "m". And we don't use the key, so we can pass
NULL instead.

https://bugzilla.gnome.org/show_bug.cgi?id=764846
2016-04-19 10:28:52 -04:00
Sébastien Wilmet 69c902a146 app: use g_set_object()
https://bugzilla.gnome.org/show_bug.cgi?id=764846
2016-04-19 10:28:45 -04:00
Sébastien Wilmet 0bb1991afb app: don't use deprecated function
gtk_application_add_accelerator() is deprecated, but was still used
inside IGNORE_DEPRECATIONS's.

https://bugzilla.gnome.org/show_bug.cgi?id=764846
2016-04-19 10:28:39 -04:00
Sébastien Wilmet 5cc3b265be app: improve doc of gtk_application_get_window_by_id()
https://bugzilla.gnome.org/show_bug.cgi?id=764846
2016-04-19 10:28:17 -04:00
Sébastien Wilmet cb2950e17f app: improve doc of gtk_application_set_accels_for_action()
When reading the API for the first time I didn't know what was the
"detailed" action name.

https://bugzilla.gnome.org/show_bug.cgi?id=764846
2016-04-19 10:28:06 -04:00
Sébastien Wilmet dc96266e66 app: avoid code duplication for setting accels
The implementation of the deprecated functions is now based on the
non-deprecated gtk_application_set_accels_for_action().

https://bugzilla.gnome.org/show_bug.cgi?id=764846
2016-04-19 10:27:19 -04:00
Sébastien Wilmet b51455712f app: fix indentation
And add missing curly braces.
2016-04-19 10:24:32 -04:00
Sébastien Wilmet 9bc3a93cf9 docs: trivial fixes in GtkApplication-related documentation 2016-04-19 10:24:07 -04:00
Olivier Fourdan 115af7c96e wayland: do not update shadows for child windows
glade-previewer places a gtkwindow inside another toplevel gtkwindow,
updating the shadow width for the client induces a busy loop where the
parent will grow continuously until it crashes gnome-shell/mutter.

To avoid the loop, do not update the shadow width if not dealing with a
toplevel window.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=761651
2016-04-19 10:23:39 -04:00
Wouter Verhelst 139cb2a510 Clarify that one cannot use the same variable
A naive way to perform an action on all parent nodes of a given node
could be to do:

while(gtk_tree_model_iter_parent(model, &iter, &iter)) {
	/* perform some action on iter here */
}

However, since gtk_tree_model_iter_parent() will initialize the iterator
pointed to by the second parameter before performing the lookup, this
will not work.

Explicitly document this behaviour.

Signed-off-by: Wouter Verhelst <w@uter.be>

https://bugzilla.gnome.org/show_bug.cgi?id=573380
2016-04-19 10:22:00 -04:00
Matthias Clasen a2a369ae1c Add a comment to explain numbers here
This explains the change in the previous commit.
2016-04-19 10:21:30 -04:00
Piotr Drąg 9d8a3e99fd cups: Fix duplicate string
https://bugzilla.gnome.org/show_bug.cgi?id=765122
2016-04-19 10:21:11 -04:00
Lapo Calamandrei 5affbbe545 Adwaita: fix infobar text color in backdrop windows
see https://bugzilla.gnome.org/show_bug.cgi?id=765213
2016-04-19 00:21:15 +02:00
Piotr Drąg dadd81768a Updated Polish translation 2016-04-18 02:36:34 +02:00
Bastien Nocera a69e59132f cups: Fix gettext usage
The previous patches didn't mark some strings as to be translated, and
tried to translate strings with a variable part already inside the
string, which isn't going to work.

Mark the strings as translatable with context, and also make sure to
translate static strings when getting them out of their structure.

https://bugzilla.gnome.org/show_bug.cgi?id=764585
2016-04-16 18:42:28 +02:00
Lapo Calamandrei dfc26939cc Adwaita: ensure dialogs titlebar rounded corners
broken from my previous commit about rounded corners, dialogs
doesn't use the "window" node, but the "dialog" node, so use the
.background styleclass in the selectors which is more generic.
2016-04-16 14:44:58 +02:00
Lapo Calamandrei c961962ce6 Adwaita: ensure titlebar corners are not rounded...
...when the window is maximized or tiled, by using more specific
selectors, since there were cases of erroneusly rounded corners.
See https://bugzilla.gnome.org/show_bug.cgi?id=765038
2016-04-16 12:07:32 +02:00
Benjamin Otte 6308d3a03d iconhelper: Invalidate on clear()
When clearing the icon helper, we need to invalidate it. Otherwise the
previous icon keeps lingering along.
This is not relevant inside gtkiconhelper.c where other code causes the
invalidation, but happens when external code calls
_gtk_icon_helper_clear().

https://bugzilla.gnome.org/show_bug.cgi?id=765066
2016-04-14 15:17:54 -04:00
Felipe Borges 71385044fe cups: make string non-literals translatable again
Notice that C_ just takes string literals as arguments.

https://bugzilla.gnome.org/show_bug.cgi?id=764585
2016-04-14 18:58:56 +02:00
Sebastien Bacher c1e82bf276 gtkplacessidebar: don't margins in the code
those should rather be defined by the theme
https://bugzilla.gnome.org/show_bug.cgi?id=763768
2016-04-14 11:47:31 +02:00
Felipe Borges 8e0c2a3fff cups: Fix more "format not a string literal" error
https://bugzilla.gnome.org/show_bug.cgi?id=764585
2016-04-13 14:27:34 +02:00
YunQiang Su 99763f3dd5 update zh_CN translation 2016-04-13 20:15:38 +08:00
YunQiang Su f655210f42 update zh_CN translation 2016-04-13 16:41:44 +08:00
Rico Tzschichholz 2b71170b12 gtk: Annotate GtkFlowBoxCreateWidgetFunc as "transfer full"
(cherry picked from commit c8d1108574)
2016-04-12 13:34:53 +02:00
Matthias Clasen 8e6171d68e 3.20.3 2016-04-11 20:04:45 -04:00
Ignacio Casal Quinteiro 667bb3c869 win32: rollback change and use _gdk_display
This makes usage of _gdk_display again when creating a window.
This is needed because there is a window created when the display
is being initialized, so it becomes a chicken and egg problem.
For now we roll back this to fix the wintab crash but we might
want to fix this again in the future by improving the wintab
initialization.

https://bugzilla.gnome.org/show_bug.cgi?id=764664
2016-04-11 22:35:43 +02:00
Arash Mousavi c752d8ad75 Update Persian translations 2016-04-11 23:11:35 +04:30
Matthias Clasen 22d3a16653 listbox: Fix css node ordering
When inserting a child at the top, we were not inserting its
css node properly.

https://bugzilla.gnome.org/show_bug.cgi?id=764710
2016-04-11 07:53:45 -04:00
Mohammed Sadik b16c9ebdf1 broadway: fix documentation
broadway backend has 0 as the default display port,
which maps to tcp port 8080.

https://bugzilla.gnome.org/show_bug.cgi?id=764835
2016-04-11 07:36:31 -04:00
Lukas K 0f85624e3d Fix gtk_scrollable_get_border annotation
https://bugzilla.gnome.org/show_bug.cgi?id=764540
(cherry picked from commit 8fc1ca1ef2)
2016-04-10 16:14:21 +02:00
Zahari Yurukov 6b401440d7 Added Bulgarian translation 2016-04-10 16:50:43 +03:00
Zahari Yurukov b9c2bbc385 Added Bulgarian translation 2016-04-10 16:31:35 +03:00
Friedrich Beckmann 6964f9dbf1 quartz: zoom/rotate change compile/runtime check from 10.7 to 10.8
The zoom/rotate change for quartz does not build on 10.7. This change
adds zoom/rotate support in quartz only for 10.8 and following. The
problems is described here:
https://bugzilla.gnome.org/show_bug.cgi?id=760276 and here
https://trac.macports.org/ticket/51052
NSEventPhaseMayBegin was only introduced in 10.8 although documentation
says it is introduced in 10.7. Tests on 10.7 indicate that the phase
property for the Magnify event is not supported at all on 10.7
2016-04-09 18:09:59 -04:00
Matthias Clasen 85df2d3729 Mention geometry handling changes in release notes 2016-04-09 17:06:45 -04:00
Olivier Fourdan 0922d4059a test: do not remove files on distclean
bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=764686
2016-04-08 17:01:56 +02:00
Руслан Ижбулатов f233609c93 GDK W32: Don't move windows into top-left corner on style change
This fixes a bug that was introduced by db1b24233e.
The reason why 0:0 coordinates were passed was that SWP_NOREPOSITION was
misinterpreted as SWP_NOMOVE. That is not the case - SWP_NOREPOSITION
prevents owner Z-order change, not the window position change.
2016-04-06 10:25:32 +00:00
Olivier Fourdan dee6d13f0d wayland: Do not resize with the same size
gnome-control-center is calling gtk_window_resize() on configure-event
signals which leads to a busy loop.

Avoids such a busy loop by not re-configuring a window with the same
size, unless this is coming from and xdg-shell configure.

bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=764374
2016-04-05 18:23:45 +02:00
Bastien Nocera 830626596b cups: Fix "format not a string literal" error
https://bugzilla.gnome.org/show_bug.cgi?id=764585
2016-04-05 13:01:59 +02:00
Bastien Nocera 3ff8f55ed0 recent-manager: Fix "format not a string literal" error
https://bugzilla.gnome.org/show_bug.cgi?id=764585
2016-04-05 13:01:50 +02:00
Bastien Nocera 7ca4d22bc3 file-chooser-widget: Fix "format not a string literal" error
https://bugzilla.gnome.org/show_bug.cgi?id=764585
2016-04-05 13:01:39 +02:00
Bastien Nocera ff8d0dc54c about-dialog: Fix "format not a string literal" errors
A non-intrusive fix.

https://bugzilla.gnome.org/show_bug.cgi?id=764585
2016-04-05 13:01:33 +02:00
Bastien Nocera 4b104c6217 ui-manager: Fix "format not a string literal" errors
Quite a bit of code movement, but necessary to build with the
default format errors produced by newer versions of GCC.

https://bugzilla.gnome.org/show_bug.cgi?id=764585
2016-04-05 13:01:24 +02:00
Benjamin Otte 6144b2276c window: Remove suspicious branch
This commit was found to make emacs windows shrink, but the reversal
caused more widespread damage than initially expected. I've send
suggested fixes to the emacs team, to avoid the shrinking window,
regardless of this commit.

Original commit message:

It seems this branch is not needed anymore. It was originally added in
1999 to support gtk_widget_realize(), but all those reasons seem
obsolete today.
Instead just call gtk_widget_realize().

If you end up at this commit when bisecting:
There is no bug that made me remove this code, it was purely meant to be
cleanup / dead code removal. I seem to have introduced a new bug or
bisecting wouldn't have let you here. So it seems we should just revert
this commit.
2016-04-04 11:22:47 -04:00
Lapo Calamandrei 17d1cd1506 Adwaita: transparent textview border border
So it will play nicely with gedit color combinations.
See https://bugzilla.gnome.org/show_bug.cgi?id=764203
2016-04-04 12:06:05 +02:00
Tom Tryfonidis 40afffb9fd Updated Greek translation 2016-04-04 09:28:23 +00:00
Kristjan SCHMIDT b088c9de26 Updated Esperanto translation 2016-04-03 02:17:55 +02:00
Kristjan SCHMIDT 17a26eef48 Updated Esperanto translation 2016-04-03 00:47:30 +02:00
Lapo Calamandrei 30e234d847 Adwaita: style textview border
see https://bugzilla.gnome.org/show_bug.cgi?id=764203
2016-04-02 16:27:10 +02:00
Lapo Calamandrei 9ce61b5c9a Adwaita: cosmetic fixes 2016-04-02 16:04:15 +02:00
Matthias Clasen 41687658ad Use dngettext instead of ngettext
Since we are a library, we have to pass the domain explicitly.

https://bugzilla.gnome.org/show_bug.cgi?id=764261
2016-04-01 23:07:13 +02:00
Carlos Garnacho b8140b74e3 wayland: Avoid NULL slave devices in GdkSeat::get_slaves
Just because we're asked for a capability, it doesn't mean we have
it.
2016-04-01 19:11:35 +02:00
Lapo Calamandrei 8d402589cf Adwaita: set secondary caret color to selection blue
see https://bugzilla.gnome.org/show_bug.cgi?id=764204
2016-04-01 16:47:14 +02:00
Rui Matos b4143c6af9 gtkwindow: Don't allow unresizable windows to be smaller than required
Commit cdc580463e made it so that
unresizable windows can't be smaller than a set default size but it
lost the logic to ensure these windows remain at least big enough to
comply with their requisition.

https://bugzilla.gnome.org/show_bug.cgi?id=764174
2016-03-31 21:04:20 +02:00
Matthias Clasen 3d76005585 icon theme: Make the builtin hicolor index match reality
We were missing all of the status directories, and a few sizes.
This was causing us to not find image-missing on systems without
hicolor icon theme (this basically only happens on Windows).

https://bugzilla.gnome.org/show_bug.cgi?id=764378
2016-03-31 07:13:16 -04:00
Matthias Clasen c8de4c9093 3.20.2 2016-03-30 22:29:48 -04:00
Theppitak Karoonboonyanan 5d29c07087 Updated Thai translation. 2016-03-31 09:14:44 +07:00
Matthias Clasen 13619963a0 Adwaita: theme acceleditor > label
We need to have an opaque background here, otherwise the underlying
cell shines through.

https://bugzilla.gnome.org/show_bug.cgi?id=764376
2016-03-30 19:53:01 -04:00
Matthias Clasen 79a2edd840 Accel cell renderer: Set a css name
Give the event box we use here the distinctive name "acceleditor".
2016-03-30 19:52:45 -04:00
Benjamin Otte f3dd4a6fee widget: queue a redraw only if resize highlighting is enabled
e8aa9b0440 introduced a new debug mode
that highlights resizes. Unfortunately it has the side effect of
always queueing redraws even when the debug mode is not enabled.
Make the redraw conditional.
2016-03-30 21:45:54 +02:00
Debarshi Ray d14cdf2998 window: Make the sample code obey the party line on geometry widgets
The geometry_widget parameter is deprecated [1]. If one is passed, we
remove GDK_HINT_BASE_SIZE and GDK_HINT_RESIZE_INC from the mask [2].

[1] commit 08974a1e9a
[2] commit f7cc4abbad

https://bugzilla.gnome.org/show_bug.cgi?id=764321
2016-03-30 13:22:50 +02:00
Debarshi Ray b6d73e7d20 window: Fix gtk_window_set_geometry_hints documentation
The geometry_widget parameter is ignored from 3.20 onwards [1], not
3.18 as mentioned in the documentation.

[1] commit 08974a1e9a

https://bugzilla.gnome.org/show_bug.cgi?id=764321
2016-03-30 13:22:50 +02:00
Руслан Ижбулатов a4c6339351 GDK W32: Implement show_window_menu()
This is achieved by sending undocumented message WM_SYSMENU
to the window.
Before doing that, the window is given WS_SYSMENU style
(to enable window menu) and some combination of
WS_MAXIMIZEBOX (for "Mazimize" item)
WS_MINIMIZEBOX (for "Minimize" item)
WS_SIZEBOX (for "Size" item)
depending on which operations are currently permissible.

WM_SYSMENU is processed by DefWindowProc(), which results
in showing the window menu. We remove extra styles
at the first opportunity (WM_INITMENU message), as they
alter the way our window is rendered.

https://bugzilla.gnome.org/show_bug.cgi?id=763851
2016-03-29 15:09:39 +00:00
Руслан Ижбулатов 884adaac9e GDK W32: Erase hidden layered windows before showing them
If a layered window was hidden and is made visible, erase its
contents before showing it. GDK will schedule a redraw, but until
then we generally don't want to show old contents.

https://bugzilla.gnome.org/show_bug.cgi?id=763783
2016-03-29 14:36:09 +00:00
Aurimas Černius ff93dfd3eb Updated Lithuanian translation 2016-03-28 17:47:45 +03:00
Matthias Clasen 8ff6d55c18 places sidebar: Plug a small memory leak
_gtk_trash_moniotr_get_icon is transfer full, so we have
to unref the icon.
2016-03-27 11:28:49 -04:00
Cosimo Cecchi 5d83553beb scale: fix marks node position for scales with value
We should only count the value node as the first/last one if its
position matches.
2016-03-27 11:28:40 -04:00
Cosimo Cecchi 23572c21be range: use gadget pointers for grab/mouse locations
Simplify code and remove the mouse location indirection.
2016-03-27 11:28:29 -04:00
Cosimo Cecchi 6e4312a49a scale: remove impossible case
We only create the gadget when the markup is not empty, so we don't
need to check again here.
2016-03-27 11:28:22 -04:00
Cosimo Cecchi ab2178e308 scale: cache pango layouts for mark labels
Constantly creating pango layouts while drawing means that animations
will be slow. Instead, cache the pango layout in the mark structure.
2016-03-27 11:28:11 -04:00
Matthias Clasen ba91d7d3a9 Revert "window: Remove suspicious branch"
This reverts commit 67ab00e01e.

Bisection showed that this commit caused emacs windows to shrink
to a small size when first shown.
2016-03-26 17:40:28 -04:00
Matthias Clasen bdb146cce5 range: Simplify highlight allocation
Since we are really only interested in the center point of the
slider allocation, the pre-computed slider geometry is perfectly
fine, just use it always. This avoids the complication with
gadget visibility.
2016-03-26 13:52:44 -04:00
Matthias Clasen 19a8fbf336 range: Avoid miscalculating highlight allocation
The slider gadget may be turned invisible as side-effect of
gtk_range_calc_slider(). If that happens,
gtk_css_gadget_get_content_allocation() returns { 0, 0, 0, 0},
which leads us to calculate a negative allocation for the highlight
node. Avoid this, by just reusing our already calculated slider
allocation in this case (it is not technically the same as the
content, allocation, but the difference hardly matter here.

https://bugzilla.gnome.org/show_bug.cgi?id=764022
2016-03-26 10:53:09 -04:00
Matthias Clasen 230dccf77b Add a test for the system rgba visual
The main point of this test is to ensure that the pixel_details
getters work as expected.
2016-03-26 10:11:48 -04:00
Matthias Clasen 91e636d64b wayland: Fully initialize the visual
The pixel details (mask, shift and precision) are supposed to
be filled in for TrueColor visuals.
2016-03-26 10:11:40 -04:00
Matthias Clasen 7b6cf538e1 Make gdk_visual_get_*_pixel_details work again
These functions are supposed to return the numbers of consecutive
1 bits in each components mask as precision. However, due to a
copy-paste mistake when this code was moved around in
commit 70d689cddd, the precision
was always reported as zero. This affects only a few applications
that directly set window background on X11 windows, such as emacs.

https://bugzilla.gnome.org/show_bug.cgi?id=764210
2016-03-26 09:36:41 -04:00
Мирослав Николић 5ebe040e6c Updated Serbian translation 2016-03-26 09:29:02 +01:00
Matthias Clasen aee69615bc HighContrastInverse: Fix suggested-action colors
Choose a suitable foreground color instead of hardcoding white.

https://bugzilla.gnome.org/show_bug.cgi?id=764170
2016-03-25 22:49:36 -04:00
Matthias Clasen 28fe00fc68 gtk3-demo: Show more button styles
Add examples for suggested-action and destructive-action
buttons in the style classes example.
2016-03-25 22:49:36 -04:00
Matthias Clasen 742a4658e8 gtk3-demo: Rename "CSS Theming" group
Call it just "Themeing" to avoid the repetition of CSS.
2016-03-25 22:49:36 -04:00
Matthias Clasen 6228da23b5 Add a css node test for scales 2016-03-25 22:49:36 -04:00
Olivier Fourdan db241d36e2 popover: raise when showing
Some other widget might have mapped and raised another child window of
the toplevel in the meantime, causing the popover window to be covered.

Raise the popover window to avoid the issue.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=763627
2016-03-25 22:49:36 -04:00
Wolfgang Stöggl 5e5372ce74 Updated German translation 2016-03-25 18:20:27 +00:00
Wolfgang Stöggl c08f4bd2a9 Updated German translation 2016-03-25 18:17:41 +00:00
Hannie Dumoleyn ecd8841d25 Updated Dutch translation 3-20 2016-03-25 13:52:44 +01:00
Milo Casagrande be624e71f4 Updated Italian translation 2016-03-25 10:58:30 +00:00
238 changed files with 50590 additions and 38859 deletions
+226
View File
@@ -1,3 +1,229 @@
Overview of Changes in GTK+ 3.20.10
===================================
* Bug fixes:
358970 gtk_scale_set_digits does not cause value to be rounded if draw-value is false...
767391 cross-fade() not cross-fading
770166 Can GtkButtons of arbitrary size be circular? The style class only accommodate...
770236 gtkbindings: Add an example for gtk_binding_entry_add_signal()
770242 gtkbindings: Clarify that widgets need has-focus for bindings to work
770332 Notebook arrow icon wrong color after creating new tab
770374 Gtk Treeview Editable overshoots column width when column width is small
770550 gtkplacessidebar: fix signal marshal
770614 GtkScale in HighContrast theme with value = 0: WARNING: allocates negative con...
770624 Fix typos.
770703 Fix crash when using page-down on GtkListBox
770849 GtkLabel with padding brokenness
774695 GtkProgressbar needs full and empty classes
774726 GtkTreeView dnd: gtk_drag_finish remove row when reorder sinse 3.20
775525 gtk_flow_box_get_child_at_index shouldn't crash with an invalid index
775864 getting-started: typo tie->the
776560 icon-browser: window opens at very narrow size, only showing 1 column of icons
779002 Race enumerating the monitors
* Translation updates:
Brazilian Portuguese
Dutch
Icelandic
Kazakh
Scottisch Gaelic
Serbian
Overview of Changes in GTK+ 3.20.9
==================================
* Bug fixes:
769287 GtkMenuToolButton:show-menu is emitted twice and breaks dynamic m...
769603 gtk+-3.20.8: underlink issue with ld.gold - build fails: ./.libs/...
Fix headerbar size allocation
Use g_snprintf instead of snprintf
* Translation updates
Brazilian Portuguese
Czech
German
Hungarian
Indonesian
Lithuanian
Polish
Portuguese
Swedish
Overview of Changes in GTK+ 3.20.8
==================================
* Revert an unintentional bump of the GLib requirement in 3.20.7
Overview of Changes in GTK+ 3.20.7
==================================
* Bugs fixed:
118959 GtkScale value '-0'
674215 regression with updating tooltips
708148 gtk_tree_view_get_path_at_pos mistakenly identifies column of ini...
745622 Selected text not highlighted in GtkInfoBar
747206 gtktextview: note on how to get line spacing between two paragraphs
764060 opening a second nautilus while a delete operation is in progress...
764203 Default background color for the 'textview border' node
765924 Improve external drives detection
766120 Scale draw_value() align changed from centre/right (H/V) to lefti...
766122 Re-used filechooser displays $pwd half of the time when shown
766341 Do not rely on memfd as it requires a fairly recent kernel
766643 Frozen windows when unmapped with pending configure event
766782 OpenGL in broadway leads to segmentation fault
767058 GtkInfoBar: right-click/context menu all white
767468 Popover over a treeview cellrenderer is hidden immediately after ...
767705 GtkActionHelper: Change a message to a warning
767766 CUPS 2.X detected incorrectly by configure
767795 Warning when the "accelerator" property of GtkShortcutsShortcut ...
767848 crash in the window test
767851 Adwaita: popover arrows broken in some orientations
768016 [Wayland] Submenus often get closed after ~2 seconds
768025 entry.warning & entry.error broken
768082 wayland: copying from Wayland to NEdit (Xwayland/Motif) doesn't work
768142 Incorrect order of $(LIBS) and $(OBJS) in Makefile.example caused...
768177 CLIPBOARD target request after PRIMARY request times out. GDK_SEL...
768485 Change the priority of the window-close idle to G_PRIORITY_DEFAULT
768657 places-view: fix open action for locations without a mount or volume
768930 reftests: override GSETTINGS_SCHEMA_DIR when running tests
769003 Adwaita: GtkCalendar uses a confusing style for week of year
769047 GtkWidget <-> GtkStyleContext API not clear
* Translation updates:
Indonesian
Norwegian bokmål
Overview of Changes in GTK+ 3.20.6
==================================
* Bugs fixed:
766694 crash on save as in any gtk3 application starting 3.20.5...
766323 GTKPopover gives warnings if visible when reparented
766336 Crash when selecting rows with rubberbanding
766737 stack: Only map children when necessary
* Translation updates:
Arabic
Overview of Changes in GTK+ 3.20.5
==================================
* Bugs fixed:
763852 gdk/wayland: event source is not multi-thread aware
765973 GtkRevealer need to always send "child-revealed" signal...
766175 Translation of quotes may misinterpreted by GTK sidebar
766233 Crash when server does not support XI2
766440 Scale slider button has stopped discerning & rendering...
766442 Broken drag & drop between windows
* Translation updates:
Kazakh
Portuguese
Overview of Changes in GTK+ 3.20.4
==================================
* Bugs fixed:
573380 gtk_tree_model_iter_parent() fails if the same iterator is used for...
620065 Several problems related to recent files
693077 GtkRecentManager doesn't send "changed" when file is deleted
749405 GtkMenuSectionBox doesn't remove submenus when parent item is removed
761651 [Wayland] glade previewer is resizing windows until it crashes gnom...
762756 keyboard focus problem on dismiss of menus under wayland
763768 Wrong margin used for the sidebar separator
764395 nautilus crashed on double clicking 'other locations'
764424 `Super` keybindings trigger without Super, on Wayland
764585 Fix "format not a string literal" errors
764825 [WAYLAND] Fn key resets scrolling
764846 Code improvements in GtkApplication
765038 Adwaita & decorations
765065 Wayland: Hover state stuck after mouse leaving the toplevel
765066 GtkColorChooser looks like it can select multiple colors
765122 Duplicate/missing string in gtkprintbackendcups
765213 info bars nearly unreadable in backdrop state because of gray font ...
765238 gtktexthandle should avoid connecting to GtkWidget::draw
765261 listbox: Page up/Down don't do anything with large rows
765270 wayland: Leave existing mods on map_virtual_modifiers
765284 debug: reduce runtime overhead in debug builds
765471 CellRendererText shows edit entry in a wrong position for small cells
765474 Wayland: Dialogs without transient parent crash the inspector
765486 builtinicon: avoid calculating font-metrics in vast majority of cases
765493 kineticscrolling: avoid stutter at tail of kinetic deceleration
765496 Clean up gtklabel.c a bit
765565 Wayland: Inspector GtkLabel drag'n'drop crashes client
765567 wayland: avoid jitter in keyboard repeat
765592 frametimings: reuse previous frame timing in common case
765640 pixelcache: reuse existing timeout source when possible
765644 Widget sizing problems with GtkProgressBar
765742 GtkRedioButton and GtkCheckButton doesn't aligned right to left lan...
765790 W32: configure does not tell which cairo version to use
765907 [Wayland] Reversed scrolling GDK_SCROLL_UP/GDK_SCROLL_DOWN in Wayland
765922 GtkScale labels extend past edge of widget and overlap neighboring ...
765981 fts warning from tracker when searching for files with "-" in name
766166 key bindings in gtk.css are ignored
* Translation uypdates:
Brazilian Portuguese
Latvian
Polish
Traditional Chinese
Overview of Changes in GTK+ 3.20.3
==================================
* Bugs fixed:
764174 Configuration dialog is too small
764203 Default background color for the 'textview border' node
764204 Primary and secondary carets/cursors not distinguishable by default
764261 gtkplacesviewrow: untranslated "%s / %s available"
764374 Busy loop while "Displays" page is active
764378 gtk3-demo won't run without hicolor-icon-theme
764540 gtk_scrollable_get_border is missing annotations
764585 Fix "format not a string literal" errors
764686 build failure after "make distclean"
764710 GtkListBox row CSS nodes do not reflect visual order
764835 broadway: fix documentation, correct display port details
764664 Segfault when initializing WINTAB pressure-sensitive tablets
* Translation updates:
Bulgarian
Esperanto
Greek
Norwegian bokmål
Persian
Overview of Changes in GTK+ 3.20.2
==================================
* Fix blue background in Emacs windows
* Fix a performance issue with excessive redraws
* Bugs fixed:
763627 menu-traditional puts popover beneath the text editor widget
763783 GDK W32: Erase hidden layered windows before showing them
763851 GDK W32: show_window_menu() is not implemented
764022 Negative content width -200 (allocation -200, extents 0x0) while...
764170 [HighContrastInverse] “suqqested-action” is white on lightgrey
764210 Strange Background Color on Emacs
764321 window: Fix gtk_window_set_geometry_hints documentation
764376 UI glitch when entering keyboard shortcut
* Translation updates:
Dutch
German
Italian
Lithuanian
Serbian
Thai
Overview of Changes in GTK+ 3.20.1
==================================
+5
View File
@@ -99,6 +99,11 @@ Release notes for 3.20
gtk_window_set_default_size() to restore it.
See https://wiki.gnome.org/HowDoI/SaveWindowState for a detailed example.
* Geometry handling in GtkWindow has been removed. If you are using the
functions gtk_window_resize_to_geometry, gtk_window_set_default_geometry,
gtk_window_parse_geometry or gtk_window_set_geometry_hints, you may need
to make some changes to your code.
* GtkDrawingArea used to implicitly render the theme background before
calling the ::draw handler. This is no longer the case. If you rely
on having a theme-provided background, call gtk_render_background()
+10 -18
View File
@@ -5,9 +5,6 @@
</ImportGroup>
<PropertyGroup Label="UserMacros">
<BinDir>$(SolutionDir)$(Configuration)\$(Platform)\bin</BinDir>
<InstalledDlls>$(BinDir)\$(GtkDllPrefix)gdk(GtkDllSuffix).dll;$(BinDir)\$(GtkDllPrefix)gtk(GtkDllSuffix).dll;$(BinDir)\$(GtkDllPrefix)gailutil(GtkDllSuffix).dll</InstalledDlls>
<InstalledBins>$(BinDir)\gtk3-demo.exe;$(BinDir)\gtk3-demo-application.exe;$(BinDir)\gtk3-icon-browser.exe;$(BinDir)\gtk-encode-symbolic-svg.exe</InstalledBins>
<InstalledBroadwayBins>$(BinDir)\broadwayd.exe</InstalledBroadwayBins>
<GtkDoInstallBin>
mkdir $(CopyDir)\bin
mkdir $(CopyDir)\lib
@@ -126,18 +123,19 @@ copy ..\..\..\gtk\org.gtk.Settings.FileChooser.gschema.xml $(CopyDir)\share\glib
copy ..\..\..\gtk\org.gtk.Settings.ColorChooser.gschema.xml $(CopyDir)\share\glib-2.0\schemas
copy ..\..\..\gtk\org.gtk.Settings.Debug.gschema.xml $(CopyDir)\share\glib-2.0\schemas
copy ..\..\..\demos\gtk-demo\org.gtk.Demo.gschema.xml $(CopyDir)\share\glib-2.0\schemas
echo "Compiling gsettings XML Files..."
$(GlibEtcInstallRoot)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas
echo "Generating icon cache......"
$(CopyDir)\bin\gtk-update-icon-cache.exe --ignore-theme-index --force "$(CopyDir)\share\icons\hicolor"
</GtkDoInstall>
<GtkDoInstallBroadwayHeaders>
copy ..\..\..\gdk\broadway\gdkbroadway.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway
#include "gdk3-broadway.vs10.headers"
</GtkDoInstallBroadwayHeaders>
<GtkPostInstall>
echo "Compiling gsettings XML Files..."
$(GlibEtcInstallRoot)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas
echo "Generating icon cache......"
$(CopyDir)\bin\gtk-update-icon-cache.exe --ignore-theme-index --force "$(CopyDir)\share\icons\hicolor"
</GtkPostInstall>
</PropertyGroup>
<PropertyGroup>
<_PropertySheetDisplayName>gtk3installsprops</_PropertySheetDisplayName>
@@ -146,15 +144,6 @@ mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway
<BuildMacro Include="BinDir">
<Value>$(BinDir)</Value>
</BuildMacro>
<BuildMacro Include="InstalledDlls">
<Value>$(InstalledDlls)</Value>
</BuildMacro>
<BuildMacro Include="InstalledBins">
<Value>$(InstalledBins)</Value>
</BuildMacro>
<BuildMacro Include="InstalledBroadwayBins">
<Value>$(InstalledBroadwayBins)</Value>
</BuildMacro>
<BuildMacro Include="GtkDoInstallBin">
<Value>$(GtkDoInstallBin)</Value>
</BuildMacro>
@@ -164,5 +153,8 @@ mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway
<BuildMacro Include="GtkDoInstallBroadwayHeaders">
<Value>$(GtkDoInstallBroadwayHeaders)</Value>
</BuildMacro>
<BuildMacro Include="GtkPostInstall">
<Value>$(GtkPostInstall)</Value>
</BuildMacro>
</ItemGroup>
</Project>
+16 -16
View File
@@ -157,29 +157,29 @@
<ItemGroup>
<CustomBuild Include="..\..\..\config.h.win32">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Installing Build Results...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkPostInstall)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">blah;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">Installing Build Results...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">$(InstalledDlls);$(InstalledBins);$(InstalledBroadwayBins);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)$(GtkPostInstall)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|Win32'">blah;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Installing Build Results...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GtkDoInstallBin)$(GtkDoInstall)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkPostInstall)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">blah;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">Installing Build Results...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">$(InstalledDlls);$(InstalledBins);$(InstalledBroadwayBins);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)$(GtkPostInstall)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_Broadway|x64'">blah;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Installing Build Results...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkPostInstall)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">blah;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">Installing Build Results...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">$(InstalledDlls);$(InstalledBins);$(InstalledBroadwayBins);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)$(GtkPostInstall)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|Win32'">blah;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Installing Build Results...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GtkDoInstallBin)$(GtkDoInstall)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(InstalledDlls);$(InstalledBins);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkPostInstall)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">blah;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">Installing Build Results...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">$(InstalledDlls);$(InstalledBins);$(InstalledBroadwayBins);%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)$(GtkPostInstall)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_Broadway|x64'">blah;%(Outputs)</Outputs>
</CustomBuild>
</ItemGroup>
<ItemGroup>
+8 -8
View File
@@ -29,7 +29,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)"
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkPostInstall)"
/>
</Configuration>
<Configuration
@@ -42,7 +42,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)"
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkPostInstall)"
/>
</Configuration>
<Configuration
@@ -56,7 +56,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)"
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)$(GtkPostInstall)"
/>
</Configuration>
<Configuration
@@ -69,7 +69,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)"
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)$(GtkPostInstall)"
/>
</Configuration>
<Configuration
@@ -84,7 +84,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)"
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkPostInstall)"
/>
</Configuration>
<Configuration
@@ -98,7 +98,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)"
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkPostInstall)"
/>
</Configuration>
<Configuration
@@ -113,7 +113,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)"
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)$(GtkPostInstall)"
/>
</Configuration>
<Configuration
@@ -127,7 +127,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)"
CommandLine="$(GtkDoInstallBin)$(GtkDoInstall)$(GtkDoInstallBroadwayHeaders)$(GtkPostInstall)"
/>
</Configuration>
</Configurations>
+12 -8
View File
@@ -128,20 +128,24 @@ copy ..\..\..\gtk\org.gtk.Settings.FileChooser.gschema.xml $(CopyDir)\share\glib
copy ..\..\..\gtk\org.gtk.Settings.ColorChooser.gschema.xml $(CopyDir)\share\glib-2.0\schemas&#x0D;&#x0A;
copy ..\..\..\gtk\org.gtk.Settings.Debug.gschema.xml $(CopyDir)\share\glib-2.0\schemas&#x0D;&#x0A;
copy ..\..\..\demos\gtk-demo\org.gtk.Demo.gschema.xml $(CopyDir)\share\glib-2.0\schemas&#x0D;&#x0A;
"
/>
<UserMacro
Name="GtkPostInstall"
Value="
echo &quot;Compiling gsettings XML Files...&quot;&#x0D;&#x0A;
$(GlibEtcInstallRoot)\bin\glib-compile-schemas.exe $(CopyDir)\share\glib-2.0\schemas&#x0D;&#x0A;
echo &quot;Generating icon cache...&quot;&#x0D;&#x0A;
$(CopyDir)\bin\gtk-update-icon-cache.exe --ignore-theme-index --force &quot;$(CopyDir)\share\icons\hicolor&quot;
"
/>
<UserMacro
Name="GtkDoInstallBroadwayHeaders"
Value="
"
/>
<UserMacro
Name="GtkDoInstallBroadwayHeaders"
Value="
copy ..\..\..\gdk\broadway\gdkbroadway.h $(CopyDir)\include\gtk-$(ApiVersion)\gdk&#x0D;&#x0A;
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gdk\broadway&#x0D;&#x0A;
#include "gdk3-broadway.headers"
"
/>
"
/>
</VisualStudioPropertySheet>
+8 -5
View File
@@ -10,8 +10,8 @@
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [20])
m4_define([gtk_micro_version], [1])
m4_define([gtk_interface_age], [1])
m4_define([gtk_micro_version], [10])
m4_define([gtk_interface_age], [10])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],
@@ -580,7 +580,7 @@ PKG_CHECK_MODULES(BASE_DEPENDENCIES,
PKG_CHECK_MODULES(CAIRO_BACKEND, [$cairo_backends])
# Remove this check once cairo_required_version reaches at least 1.14.4
# Remove this check once cairo_required_version reaches at least 1.16.0
case $host_os in
mingw*)
PKG_CHECK_MODULES(CAIRO, [cairo >= cairo_required_version])
@@ -588,7 +588,7 @@ case $host_os in
[AC_MSG_RESULT([found])],
[AC_MSG_ERROR(
[cairo_win32_surface_create_with_format is not found in cairo library
You need cairo version newer than 2015-04-14])])
You need a cairo snapshot 1.15.x or 1.16.x release or newer])])
;;
*)
;;
@@ -794,6 +794,9 @@ LIBS="$LIBS $GLIB_LIBS"
AC_CHECK_FUNCS(bind_textdomain_codeset)
LIBS=$gtk_save_LIBS
AC_CHECK_HEADERS(linux/memfd.h,
AC_DEFINE(HAVE_LINUX_MEMFD_H, 1,
[Define to 1 if memfd.h is available]))
AC_CHECK_HEADERS(sys/mman.h,
AC_DEFINE(HAVE_SYS_MMAN_H, 1,
[Define to 1 if mman.h is available]))
@@ -1472,7 +1475,7 @@ else
CUPS_API_MAJOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $1}'`
CUPS_API_MINOR=`echo $ECHO_N $CUPS_API_VERSION | awk -F. '{print $2}'`
if test $CUPS_API_MAJOR -gt 1 -o \
if test $CUPS_API_MAJOR -lt 1 -o \
$CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -lt 2; then
AC_MSG_ERROR([CUPS >= 1.2 not found])
fi
+1 -1
View File
@@ -1,4 +1,4 @@
/* CSS Theming/CSS Accordion
/* Theming/CSS Accordion
*
* A simple accordion demo written using CSS transitions and multiple backgrounds
*
+1 -1
View File
@@ -1,4 +1,4 @@
/* CSS Theming/CSS Basics
/* Theming/CSS Basics
*
* Gtk themes are written using CSS. Every widget is build of multiple items
* that you can style very similarly to a regular website.
+1 -1
View File
@@ -1,4 +1,4 @@
/* CSS Theming/Multiple Backgrounds
/* Theming/Multiple Backgrounds
*
* Gtk themes are written using CSS. Every widget is build of multiple items
* that you can style very similarly to a regular website.
+1 -1
View File
@@ -1,4 +1,4 @@
/* CSS Theming/Animated Backgrounds
/* Theming/Animated Backgrounds
*
* This demo is done in honour of the Pixbufs demo further down.
* It is done exclusively with CSS as the background of the window.
+1 -1
View File
@@ -1,4 +1,4 @@
/* CSS Theming/Shadows
/* Theming/Shadows
*
* This demo shows how to use CSS shadows.
*/
+3 -1
View File
@@ -28,7 +28,8 @@ source_toggled (GtkToggleButton *button)
markup = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
gtk_text_buffer_get_start_iter (buffer, &start);
gtk_text_buffer_get_bounds (buffer, &start, &end);
gtk_text_buffer_delete (buffer, &start, &end);
gtk_text_buffer_insert_markup (buffer, &start, markup, -1);
g_free (markup);
@@ -67,6 +68,7 @@ do_markup (GtkWidget *do_widget)
g_signal_connect (show_source, "toggled", G_CALLBACK (source_toggled), stack);
header = gtk_header_bar_new ();
gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (header), TRUE);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), show_source);
gtk_widget_show_all (header);
gtk_window_set_titlebar (GTK_WINDOW (window), header);
+6 -3
View File
@@ -12,10 +12,13 @@ static guint timeout = 0;
static void
change_direction (GtkRevealer *revealer)
{
gboolean revealed;
if (gtk_widget_get_mapped (GTK_WIDGET (revealer)))
{
gboolean revealed;
revealed = gtk_revealer_get_child_revealed (revealer);
gtk_revealer_set_reveal_child (revealer, !revealed);
revealed = gtk_revealer_get_child_revealed (revealer);
gtk_revealer_set_reveal_child (revealer, !revealed);
}
}
static gboolean
+6
View File
@@ -4,14 +4,20 @@
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">4</property>
<property name="value">2</property>
<property name="step-increment">0.1</property>
<property name="page-increment">1</property>
</object>
<object class="GtkAdjustment" id="adjustment2">
<property name="upper">4</property>
<property name="value">2</property>
<property name="step-increment">0.1</property>
<property name="page-increment">1</property>
</object>
<object class="GtkAdjustment" id="adjustment3">
<property name="upper">4</property>
<property name="value">2</property>
<property name="step-increment">0.1</property>
<property name="page-increment">1</property>
</object>
<object class="GtkWindow" id="window1">
<property name="title" translatable="yes">Scales</property>
+36 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkGrid" id="grid">
<property name="row-spacing">6</property>
<property name="row-spacing">10</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkToolbar">
@@ -271,5 +271,40 @@
</child>
</object>
</child>
<child>
<object class="GtkBox">
<property name="visible">1</property>
<property name="spacing">10</property>
<property name="orientation">horizontal</property>
<child>
<object class="GtkButton">
<property name="visible">1</property>
<property name="label">Plain</property>
<property name="halign">end</property>
</object>
<packing>
<property name="expand">1</property>
</packing>
</child>
<child>
<object class="GtkButton">
<property name="visible">1</property>
<property name="label">Destructive</property>
<style>
<class name="destructive-action"/>
</style>
</object>
</child>
<child>
<object class="GtkButton">
<property name="visible">1</property>
<property name="label">Suggested</property>
<style>
<class name="suggested-action"/>
</style>
</object>
</child>
</object>
</child>
</object>
</interface>
+2 -1
View File
@@ -1,4 +1,4 @@
/* CSS Theming/Style Classes
/* Theming/Style Classes
*
* GTK+ uses CSS for theming. Style classes can be associated
* with widgets to inform the theme about intended rendering.
@@ -24,6 +24,7 @@ do_theming_style_classes (GtkWidget *do_widget)
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Style Classes");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (window), 12);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed), &window);
-5
View File
@@ -289,7 +289,6 @@ add_columns (GtkTreeView *treeview)
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
/* havoc column */
@@ -311,7 +310,6 @@ add_columns (GtkTreeView *treeview)
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
/* tim column */
@@ -334,7 +332,6 @@ add_columns (GtkTreeView *treeview)
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
/* owen column */
@@ -356,7 +353,6 @@ add_columns (GtkTreeView *treeview)
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
/* dave column */
@@ -378,7 +374,6 @@ add_columns (GtkTreeView *treeview)
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1);
gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column),
GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
}
+2 -2
View File
@@ -8,8 +8,8 @@
</object>
<template class="IconBrowserWindow" parent="GtkApplicationWindow">
<property name="title" translatable="yes">Icon Browser</property>
<property name="default-width">600</property>
<property name="default-height">800</property>
<property name="default-width">1024</property>
<property name="default-height">768</property>
<signal name="key-press-event" handler="key_press_event_cb"/>
<child type="titlebar">
<object class="GtkHeaderBar" id="header">
+16
View File
@@ -1625,6 +1625,16 @@ reset_icon_size (GtkWidget *iv)
gtk_widget_queue_resize (iv);
}
static void
adjustment3_value_changed (GtkAdjustment *adj, GtkProgressBar *pbar)
{
double fraction;
fraction = gtk_adjustment_get_value (adj) / (gtk_adjustment_get_upper (adj) - gtk_adjustment_get_lower (adj));
gtk_progress_bar_set_fraction (pbar, fraction);
}
static void
activate (GApplication *app)
{
@@ -1896,6 +1906,12 @@ activate (GApplication *app)
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "decrease_button");
g_object_set_data (G_OBJECT (widget), "decrease_button", widget2);
adj = (GtkAdjustment *)gtk_builder_get_object (builder, "adjustment3");
widget = (GtkWidget *)gtk_builder_get_object (builder, "progressbar1");
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "progressbar2");
g_signal_connect (adj, "value-changed", G_CALLBACK (adjustment3_value_changed), widget);
g_signal_connect (adj, "value-changed", G_CALLBACK (adjustment3_value_changed), widget2);
gtk_widget_show_all (GTK_WIDGET (window));
g_object_unref (builder);
+2 -2
View File
@@ -103,8 +103,9 @@
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment3">
<property name="lower">0</property>
<property name="upper">4</property>
<property name="value">1</property>
<property name="value">2</property>
<property name="step_increment">1</property>
<property name="page_increment">1</property>
</object>
@@ -4091,7 +4092,6 @@ bad things might happen.</property>
</action-widgets>
</object>
<object class="GtkPopover" id="open_popover">
<property name="visible">1</property>
<child>
<object class="GtkGrid">
<property name="visible">1</property>
+4 -4
View File
@@ -43,10 +43,10 @@ To use broadwayd, start it like this:
<programlisting>
broadwayd :5
</programlisting>
Then point your web browser at <literal>http://127.0.0.1:8084</literal>.
Then point your web browser at <literal>http://127.0.0.1:8085</literal>.
Start your applications like this:
<programlisting>
BROADWAY_DISPLAY=:5 gtk3-demo
GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 gtk3-demo
</programlisting>
</para>
@@ -58,11 +58,11 @@ BROADWAY_DISPLAY=:5 gtk3-demo
<title><envar>BROADWAY_DISPLAY</envar></title>
<para>
Specifies the Broadway display number. The default display is 1.
Specifies the Broadway display number. The default display is 0.
The display number determines the port to use when connecting
to a Broadway application via the following formula:
<programlisting>
<replaceable>port</replaceable> = 8080 + (<replaceable>display</replaceable> - 1)
<replaceable>port</replaceable> = 8080 + <replaceable>display</replaceable>
</programlisting>
</para>
</formalpara>
+3 -3
View File
@@ -45,14 +45,14 @@ windows in the same web browser, by connecting to broadwayd.
</para>
<para>
When using broadwayd, specify the display number to use, prefixed
with a colon, similar to X. The default display number is 1.
with a colon, similar to X. The default display number is 0.
<programlisting>
broadwayd :5
</programlisting>
Then point your web browser at <literal>http://127.0.0.1:8084</literal>.
Then point your web browser at <literal>http://127.0.0.1:8085</literal>.
Start your applications like this:
<programlisting>
BROADWAY_DISPLAY=:5 gtk3-demo
GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 gtk3-demo
</programlisting>
You can add password protection for your session by creating a file in
+1 -1
View File
@@ -1051,7 +1051,7 @@ example_app_window_init (ExampleAppWindow *win)
<para>The contents of a widget often need to be partially or fully redrawn,
e.g. when another window is moved and uncovers part of the widget, or
when tie window containing it is resized. It is also possible to explicitly
when the window containing it is resized. It is also possible to explicitly
cause part or all of the widget to be redrawn, by calling
gtk_widget_queue_draw() or its variants. GTK+ takes care of most of the
details by providing a ready-to-use cairo context to the ::draw signal
+7 -1
View File
@@ -1133,7 +1133,7 @@ gtk_arrow_draw (GtkWidget *widget,
The default values for the #GtkScrolledWindow:hscrollbar-policy and
#GtkScrolledWindow:vscrollbar-policy properties have been changed from
'never' to 'automatic'. If your application was relying on the default
value, you will have explicitly set it explicitly.
value, you will have to set it explicitly.
</para>
<para>
@@ -1205,6 +1205,12 @@ gtk_arrow_draw (GtkWidget *widget,
have disappeared, and instead there are now
gtk_window_set_has_resize_grip() and gtk_window_get_has_resize_grip().
</para>
<para>
In more recent versions of GTK+ 3, the resize grip functionality has
been removed entirely, in favor of invisible resize borders around the
window. When updating to newer versions of GTK+ 3, you should simply
remove all code dealing with resize grips.
</para>
</section>
<section>
+1 -1
View File
@@ -13,7 +13,7 @@ all: exampleapp
$(CC) -c -o $(@F) $(CFLAGS) $<
exampleapp: $(OBJS)
$(CC) -o $(@F) $(LIBS) $(OBJS)
$(CC) -o $(@F) $(OBJS) $(LIBS)
clean:
rm -f $(OBJS)
+1 -1
View File
@@ -25,7 +25,7 @@ resources.c: exampleapp.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --source
$(CC) -c -o $(@F) $(CFLAGS) $<
exampleapp: $(OBJS) gschemas.compiled
$(CC) -o $(@F) $(LIBS) $(OBJS)
$(CC) -o $(@F) $(OBJS) $(LIBS)
clean:
rm -f org.gtk.exampleapp.gschema.valid
+1 -1
View File
@@ -18,7 +18,7 @@ resources.c: exampleapp.gresource.xml window.ui
$(CC) -c -o $(@F) $(CFLAGS) $<
exampleapp: $(OBJS)
$(CC) -o $(@F) $(LIBS) $(OBJS)
$(CC) -o $(@F) $(OBJS) $(LIBS)
clean:
rm -f $(BUILT_SRC)
+1 -1
View File
@@ -18,7 +18,7 @@ resources.c: exampleapp.gresource.xml window.ui
$(CC) -c -o $(@F) $(CFLAGS) $<
exampleapp: $(OBJS)
$(CC) -o $(@F) $(LIBS) $(OBJS)
$(CC) -o $(@F) $(OBJS) $(LIBS)
clean:
rm -f $(BUILT_SRC)
+1 -1
View File
@@ -18,7 +18,7 @@ resources.c: exampleapp.gresource.xml window.ui app-menu.ui
$(CC) -c -o $(@F) $(CFLAGS) $<
exampleapp: $(OBJS)
$(CC) -o $(@F) $(LIBS) $(OBJS)
$(CC) -o $(@F) $(OBJS) $(LIBS)
clean:
rm -f $(BUILT_SRC)
+1 -1
View File
@@ -25,7 +25,7 @@ resources.c: exampleapp.gresource.xml window.ui app-menu.ui
$(CC) -c -o $(@F) $(CFLAGS) $<
exampleapp: $(OBJS) gschemas.compiled
$(CC) -o $(@F) $(LIBS) $(OBJS)
$(CC) -o $(@F) $(OBJS) $(LIBS)
clean:
rm -f org.gtk.exampleapp.gschema.valid
+1 -1
View File
@@ -25,7 +25,7 @@ resources.c: exampleapp.gresource.xml window.ui app-menu.ui
$(CC) -c -o $(@F) $(CFLAGS) $<
exampleapp: $(OBJS) gschemas.compiled
$(CC) -o $(@F) $(LIBS) $(OBJS)
$(CC) -o $(@F) $(OBJS) $(LIBS)
clean:
rm -f org.gtk.exampleapp.gschema.valid
+1 -1
View File
@@ -25,7 +25,7 @@ resources.c: exampleapp.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --source
$(CC) -c -o $(@F) $(CFLAGS) $<
exampleapp: $(OBJS) gschemas.compiled
$(CC) -o $(@F) $(LIBS) $(OBJS)
$(CC) -o $(@F) $(OBJS) $(LIBS)
clean:
rm -f org.gtk.exampleapp.gschema.valid
+1 -1
View File
@@ -25,7 +25,7 @@ resources.c: exampleapp.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --source
$(CC) -c -o $(@F) $(CFLAGS) $<
exampleapp: $(OBJS) gschemas.compiled
$(CC) -o $(@F) $(LIBS) $(OBJS)
$(CC) -o $(@F) $(OBJS) $(LIBS)
clean:
rm -f org.gtk.exampleapp.gschema.valid
+1 -1
View File
@@ -25,7 +25,7 @@ resources.c: exampleapp.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --source
$(CC) -c -o $(@F) $(CFLAGS) $<
exampleapp: $(OBJS) gschemas.compiled
$(CC) -o $(@F) $(LIBS) $(OBJS)
$(CC) -o $(@F) $(OBJS) $(LIBS)
clean:
rm -f org.gtk.exampleapp.gschema.valid
+1 -1
View File
@@ -187,7 +187,7 @@ common_sources = \
libgdk_3_la_SOURCES = $(common_sources)
libgdk_3_la_CFLAGS = $(AM_CFLAGS) $(GDK_HIDDEN_VISIBILITY_CFLAGS)
libgdk_3_la_LIBADD = $(GDK_DEP_LIBS)
libgdk_3_la_LIBADD = $(GDK_DEP_LIBS) $(SHM_LIBS)
libgdk_3_la_LDFLAGS = $(LDADD)
if USE_X11
+1
View File
@@ -98,6 +98,7 @@ _gdk_broadway_window_drag_begin (GdkWindow *window,
new_context = g_object_new (GDK_TYPE_BROADWAY_DRAG_CONTEXT,
NULL);
new_context->display = gdk_window_get_display (window);
return new_context;
}
+3 -2
View File
@@ -752,7 +752,8 @@ gdk_drag_context_handle_source_event (GdkEvent *event)
}
GdkCursor *
gdk_drag_get_cursor (GdkDragAction action)
gdk_drag_get_cursor (GdkDragContext *context,
GdkDragAction action)
{
gint i;
@@ -761,7 +762,7 @@ gdk_drag_get_cursor (GdkDragAction action)
break;
if (drag_cursors[i].cursor == NULL)
drag_cursors[i].cursor = gdk_cursor_new_from_name (gdk_display_get_default (),
drag_cursors[i].cursor = gdk_cursor_new_from_name (context->display,
drag_cursors[i].name);
return drag_cursors[i].cursor;
}
+4 -1
View File
@@ -94,6 +94,8 @@ struct _GdkDragContext {
/*< private >*/
GdkDragProtocol protocol;
GdkDisplay *display;
gboolean is_source;
GdkWindow *source_window;
GdkWindow *dest_window;
@@ -119,7 +121,8 @@ void gdk_drag_context_cancel (GdkDragContext *context,
GdkDragCancelReason reason);
gboolean gdk_drag_context_handle_source_event (GdkEvent *event);
gboolean gdk_drag_context_handle_dest_event (GdkEvent *event);
GdkCursor * gdk_drag_get_cursor (GdkDragAction action);
GdkCursor * gdk_drag_get_cursor (GdkDragContext *context,
GdkDragAction action);
G_END_DECLS
+1 -6
View File
@@ -295,6 +295,7 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
while (pending_motions && pending_motions->next != NULL)
{
GList *next = pending_motions->next;
gdk_event_free (pending_motions->data);
display->queued_events = g_list_delete_link (display->queued_events,
pending_motions);
pending_motions = next;
@@ -2066,12 +2067,6 @@ gdk_get_show_events (void)
return (_gdk_debug_flags & GDK_DEBUG_EVENTS) != 0;
}
/* What do we do with G_IO_NVAL?
*/
#define READ_CONDITION (G_IO_IN | G_IO_HUP | G_IO_ERR)
#define WRITE_CONDITION (G_IO_OUT | G_IO_ERR)
#define EXCEPTION_CONDITION (G_IO_PRI)
static void
gdk_synthesize_click (GdkDisplay *display,
GdkEvent *event,
+52 -4
View File
@@ -416,12 +416,18 @@ _gdk_frame_clock_begin_frame (GdkFrameClock *frame_clock)
priv->frame_counter++;
priv->current = (priv->current + 1) % FRAME_HISTORY_MAX_LENGTH;
/* Try to steal the previous frame timing instead of discarding
* and allocating a new one.
*/
if G_LIKELY (priv->n_timings == FRAME_HISTORY_MAX_LENGTH &&
_gdk_frame_timings_steal (priv->timings[priv->current],
priv->frame_counter))
return;
if (priv->n_timings < FRAME_HISTORY_MAX_LENGTH)
priv->n_timings++;
else
{
gdk_frame_timings_unref(priv->timings[priv->current]);
}
gdk_frame_timings_unref(priv->timings[priv->current]);
priv->timings[priv->current] = _gdk_frame_timings_new (priv->frame_counter);
}
@@ -471,7 +477,7 @@ gdk_frame_clock_get_timings (GdkFrameClock *frame_clock,
*
* Returns: (nullable): the #GdkFrameTimings for the frame currently
* being processed, or even no frame is being processed, for the
* previous frame. Before any frames have been procesed, returns
* previous frame. Before any frames have been processed, returns
* %NULL.
* Since: 3.8
*/
@@ -603,3 +609,45 @@ gdk_frame_clock_get_refresh_info (GdkFrameClock *frame_clock,
frame_counter--;
}
}
void
_gdk_frame_clock_emit_flush_events (GdkFrameClock *frame_clock)
{
g_signal_emit (frame_clock, signals[FLUSH_EVENTS], 0);
}
void
_gdk_frame_clock_emit_before_paint (GdkFrameClock *frame_clock)
{
g_signal_emit (frame_clock, signals[BEFORE_PAINT], 0);
}
void
_gdk_frame_clock_emit_update (GdkFrameClock *frame_clock)
{
g_signal_emit (frame_clock, signals[UPDATE], 0);
}
void
_gdk_frame_clock_emit_layout (GdkFrameClock *frame_clock)
{
g_signal_emit (frame_clock, signals[LAYOUT], 0);
}
void
_gdk_frame_clock_emit_paint (GdkFrameClock *frame_clock)
{
g_signal_emit (frame_clock, signals[PAINT], 0);
}
void
_gdk_frame_clock_emit_after_paint (GdkFrameClock *frame_clock)
{
g_signal_emit (frame_clock, signals[AFTER_PAINT], 0);
}
void
_gdk_frame_clock_emit_resume_events (GdkFrameClock *frame_clock)
{
g_signal_emit (frame_clock, signals[RESUME_EVENTS], 0);
}
+7 -7
View File
@@ -307,7 +307,7 @@ gdk_frame_clock_flush_idle (void *data)
priv->phase = GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS;
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS;
g_signal_emit_by_name (G_OBJECT (clock), "flush-events");
_gdk_frame_clock_emit_flush_events (clock);
if ((priv->requested & ~GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS) != 0 ||
priv->updating_count > 0)
@@ -366,7 +366,7 @@ gdk_frame_clock_paint_idle (void *data)
* in them.
*/
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT;
g_signal_emit_by_name (G_OBJECT (clock), "before-paint");
_gdk_frame_clock_emit_before_paint (clock);
priv->phase = GDK_FRAME_CLOCK_PHASE_UPDATE;
}
/* fallthrough */
@@ -377,7 +377,7 @@ gdk_frame_clock_paint_idle (void *data)
priv->updating_count > 0)
{
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_UPDATE;
g_signal_emit_by_name (G_OBJECT (clock), "update");
_gdk_frame_clock_emit_update (clock);
}
}
/* fallthrough */
@@ -405,7 +405,7 @@ gdk_frame_clock_paint_idle (void *data)
priv->freeze_count == 0 && iter++ < 4)
{
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_LAYOUT;
g_signal_emit_by_name (G_OBJECT (clock), "layout");
_gdk_frame_clock_emit_layout (clock);
}
if (iter == 5)
g_warning ("gdk-frame-clock: layout continuously requested, giving up after 4 tries");
@@ -427,7 +427,7 @@ gdk_frame_clock_paint_idle (void *data)
if (priv->requested & GDK_FRAME_CLOCK_PHASE_PAINT)
{
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_PAINT;
g_signal_emit_by_name (G_OBJECT (clock), "paint");
_gdk_frame_clock_emit_paint (clock);
}
}
/* fallthrough */
@@ -435,7 +435,7 @@ gdk_frame_clock_paint_idle (void *data)
if (priv->freeze_count == 0)
{
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_AFTER_PAINT;
g_signal_emit_by_name (G_OBJECT (clock), "after-paint");
_gdk_frame_clock_emit_after_paint (clock);
/* the ::after-paint phase doesn't get repeated on freeze/thaw,
*/
priv->phase = GDK_FRAME_CLOCK_PHASE_NONE;
@@ -462,7 +462,7 @@ gdk_frame_clock_paint_idle (void *data)
if (priv->requested & GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS)
{
priv->requested &= ~GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS;
g_signal_emit_by_name (G_OBJECT (clock), "resume-events");
_gdk_frame_clock_emit_resume_events (clock);
}
if (priv->freeze_count == 0)
+11 -1
View File
@@ -111,7 +111,17 @@ void _gdk_frame_clock_begin_frame (GdkFrameClock *clock);
void _gdk_frame_clock_debug_print_timings (GdkFrameClock *clock,
GdkFrameTimings *timings);
GdkFrameTimings *_gdk_frame_timings_new (gint64 frame_counter);
GdkFrameTimings *_gdk_frame_timings_new (gint64 frame_counter);
gboolean _gdk_frame_timings_steal (GdkFrameTimings *timings,
gint64 frame_counter);
void _gdk_frame_clock_emit_flush_events (GdkFrameClock *frame_clock);
void _gdk_frame_clock_emit_before_paint (GdkFrameClock *frame_clock);
void _gdk_frame_clock_emit_update (GdkFrameClock *frame_clock);
void _gdk_frame_clock_emit_layout (GdkFrameClock *frame_clock);
void _gdk_frame_clock_emit_paint (GdkFrameClock *frame_clock);
void _gdk_frame_clock_emit_after_paint (GdkFrameClock *frame_clock);
void _gdk_frame_clock_emit_resume_events (GdkFrameClock *frame_clock);
G_END_DECLS
+17
View File
@@ -17,6 +17,8 @@
#include "config.h"
#include <string.h>
#include "gdkframeclockprivate.h"
/**
@@ -48,6 +50,21 @@ _gdk_frame_timings_new (gint64 frame_counter)
return timings;
}
gboolean
_gdk_frame_timings_steal (GdkFrameTimings *timings,
gint64 frame_counter)
{
if (timings->ref_count == 1)
{
memset (timings, 0, sizeof *timings);
timings->ref_count = 1;
timings->frame_counter = frame_counter;
return TRUE;
}
return FALSE;
}
/**
* gdk_frame_timings_ref:
* @timings: a #GdkFrameTimings
+12
View File
@@ -248,11 +248,23 @@ gdk_gl_context_upload_texture (GdkGLContext *context,
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
}
static gboolean
gdk_gl_context_real_realize (GdkGLContext *self,
GError **error)
{
g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
"The current backend does not support OpenGL");
return FALSE;
}
static void
gdk_gl_context_class_init (GdkGLContextClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
klass->realize = gdk_gl_context_real_realize;
/**
* GdkGLContext:display:
*
+1 -1
View File
@@ -613,7 +613,7 @@ gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap,
* This function is useful when matching key events against
* accelerators.
*
* Returns: %TRUE if no virtual modifiers were mapped to the
* Returns: %FALSE if two virtual modifiers were mapped to the
* same non-virtual modifier. Note that %FALSE is also returned
* if a virtual modifier is mapped to a non-virtual modifier that
* was already set in @state.
-1
View File
@@ -371,7 +371,6 @@ gdk_visual_get_pixel_details (GdkVisual *visual,
m >>= 1;
}
m = pixel_mask;
while (m & 0x1)
{
p++;
+39 -6
View File
@@ -2769,11 +2769,20 @@ gdk_window_get_paint_gl_context (GdkWindow *window,
if (window->impl_window->gl_paint_context == NULL)
{
GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
if (impl_class->create_gl_context == NULL)
{
g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
_("The current backend does not support OpenGL"));
return NULL;
}
window->impl_window->gl_paint_context =
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window,
TRUE,
NULL,
&internal_error);
impl_class->create_gl_context (window->impl_window,
TRUE,
NULL,
&internal_error);
}
if (internal_error != NULL)
@@ -7663,6 +7672,7 @@ is_button_type (GdkEventType type)
type == GDK_BUTTON_RELEASE ||
type == GDK_TOUCH_BEGIN ||
type == GDK_TOUCH_END ||
type == GDK_TOUCH_CANCEL ||
type == GDK_SCROLL;
}
@@ -9286,6 +9296,7 @@ proxy_button_event (GdkEvent *source_event,
case GDK_TOUCH_BEGIN:
case GDK_TOUCH_END:
case GDK_TOUCH_CANCEL:
convert_toplevel_coords_to_window (event_win,
toplevel_x, toplevel_y,
&event->button.x, &event->button.y);
@@ -9301,7 +9312,7 @@ proxy_button_event (GdkEvent *source_event,
gdk_event_set_source_device (event, source_device);
if ((type == GDK_TOUCH_END &&
if (((type == GDK_TOUCH_END || type == GDK_TOUCH_CANCEL) &&
_gdk_event_get_pointer_emulated (source_event)) &&
pointer_window == pointer_info->window_under_pointer &&
gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN)
@@ -9810,6 +9821,25 @@ gdk_window_create_similar_surface (GdkWindow * window,
* Initially the surface contents are all 0 (transparent if contents
* have transparency, black otherwise.)
*
* The @width and @height of the new surface are not affected by
* the scaling factor of the @window, or by the @scale argument; they
* are the size of the surface in device pixels. If you wish to create
* an image surface capable of holding the contents of @window you can
* use:
*
* |[<!-- language="C" -->
* int scale = gdk_window_get_scale_factor (window);
* int width = gdk_window_get_width (window) * scale;
* int height = gdk_window_get_height (window) * scale;
*
* // format is set elsewhere
* cairo_surface_t *surface =
* gdk_window_create_similar_image_surface (window,
* format,
* width, height,
* scale);
* ]|
*
* Returns: a pointer to the newly allocated surface. The caller
* owns the surface and should call cairo_surface_destroy() when done
* with it.
@@ -10284,7 +10314,8 @@ gdk_window_get_event_compression (GdkWindow *window)
* image quality since the window manager may only need to scale the
* icon by a small amount or not at all.
*
**/
* Note that some platforms don't support window icons.
*/
void
gdk_window_set_icon_list (GdkWindow *window,
GList *pixbufs)
@@ -10307,6 +10338,8 @@ gdk_window_set_icon_list (GdkWindow *window,
*
* Using %NULL for @name unsets the icon title; further calls to
* gdk_window_set_title() will again update the icon title as well.
*
* Note that some platforms don't support window icons.
**/
void
gdk_window_set_icon_name (GdkWindow *window,
+2
View File
@@ -587,6 +587,8 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
window = [[self contentView] gdkWindow];
current_context->display = gdk_window_get_display (window);
device_manager = gdk_display_get_device_manager (gdk_display_get_default ());
gdk_drag_context_set_device (current_context,
gdk_device_manager_get_client_pointer (device_manager));
+1
View File
@@ -44,6 +44,7 @@ _gdk_quartz_window_drag_begin (GdkWindow *window,
/* Create fake context */
_gdk_quartz_drag_source_context = g_object_new (GDK_TYPE_QUARTZ_DRAG_CONTEXT,
NULL);
_gdk_quartz_drag_source_context->display = gdk_window_get_display (window);
_gdk_quartz_drag_source_context->is_source = TRUE;
_gdk_quartz_drag_source_context->source_window = window;
+5 -4
View File
@@ -906,7 +906,7 @@ fill_crossing_event (GdkWindow *toplevel,
such that PINCH(STARTED), PINCH(UPDATE).... will not show a second
PINCH(STARTED) event.
*/
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
static void
fill_pinch_event (GdkWindow *window,
GdkEvent *event,
@@ -1002,7 +1002,7 @@ fill_pinch_event (GdkWindow *window,
}
event->touchpad_pinch.scale = last_scale;
}
#endif /* OSX Version >= 10.7 */
#endif /* OSX Version >= 10.8 */
static void
fill_button_event (GdkWindow *window,
@@ -1647,11 +1647,12 @@ gdk_event_translate (GdkEvent *event,
}
}
break;
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
case NSEventTypeMagnify:
case NSEventTypeRotate:
/* Event handling requires [NSEvent phase] which was introduced in 10.7 */
if (gdk_quartz_osx_version () >= GDK_OSX_LION)
/* However - Tests on 10.7 showed that phase property does not work */
if (gdk_quartz_osx_version () >= GDK_OSX_MOUNTAIN_LION)
fill_pinch_event (window, event, nsevent, x, y, x_root, y_root);
else
return_val = FALSE;
+1 -1
View File
@@ -14,7 +14,7 @@ AM_CPPFLAGS = \
$(GTK_DEBUG_FLAGS) \
$(GDK_DEP_CFLAGS)
LDADDS = $(GDK_DEP_LIBS)
LDADDS = $(GDK_DEP_LIBS) $(SHM_LIBS)
noinst_LTLIBRARIES = \
libgdk-wayland.la
+61 -35
View File
@@ -110,6 +110,7 @@ struct _GdkWaylandSeat
guint32 repeat_timer;
guint32 repeat_key;
guint32 repeat_count;
gint64 repeat_deadline;
GSettings *keyboard_settings;
guint cursor_timeout_id;
@@ -404,7 +405,8 @@ gdk_wayland_device_query_state (GdkDevice *device,
if (root_window)
*root_window = gdk_screen_get_root_window (default_screen);
if (child_window)
*child_window = seat->pointer_focus;
/* Set child only if actually a child of the given window, as XIQueryPointer() does */
*child_window = g_list_find (window->children, seat->pointer_focus) ? seat->pointer_focus : NULL;
if (mask)
*mask = seat->button_modifiers | seat->key_modifiers;
@@ -965,6 +967,9 @@ primary_selection_selection (void *data,
GdkWaylandSeat *seat = data;
GdkAtom selection;
if (!seat->keyboard_focus)
return;
GDK_NOTE (EVENTS,
g_message ("primary selection selection, device %p, data offer %p",
gtk_primary_selection_device, gtk_primary_offer));
@@ -1049,31 +1054,36 @@ flush_scroll_event (GdkWaylandSeat *seat,
else if (pointer_frame->discrete_x < 0)
direction = GDK_SCROLL_RIGHT;
else if (pointer_frame->discrete_y > 0)
direction = GDK_SCROLL_UP;
else
direction = GDK_SCROLL_DOWN;
else
direction = GDK_SCROLL_UP;
flush_discrete_scroll_event (seat, direction);
pointer_frame->discrete_x = 0;
pointer_frame->discrete_y = 0;
}
/* Axes can stop independently, if we stop on one axis but have a
* delta on the other, we don't count it as a stop event.
*/
if (pointer_frame->is_scroll_stop &&
pointer_frame->delta_x == 0 &&
pointer_frame->delta_y == 0)
is_stop = TRUE;
if (pointer_frame->is_scroll_stop ||
pointer_frame->delta_x != 0 ||
pointer_frame->delta_y != 0)
{
/* Axes can stop independently, if we stop on one axis but have a
* delta on the other, we don't count it as a stop event.
*/
if (pointer_frame->is_scroll_stop &&
pointer_frame->delta_x == 0 &&
pointer_frame->delta_y == 0)
is_stop = TRUE;
flush_smooth_scroll_event (seat,
pointer_frame->delta_x,
pointer_frame->delta_y,
is_stop);
flush_smooth_scroll_event (seat,
pointer_frame->delta_x,
pointer_frame->delta_y,
is_stop);
pointer_frame->delta_x = 0;
pointer_frame->delta_y = 0;
pointer_frame->discrete_x = 0;
pointer_frame->discrete_y = 0;
pointer_frame->is_scroll_stop = FALSE;
pointer_frame->delta_x = 0;
pointer_frame->delta_y = 0;
pointer_frame->is_scroll_stop = FALSE;
}
}
static void
@@ -1378,9 +1388,6 @@ pointer_handle_frame (void *data,
{
GdkWaylandSeat *seat = data;
if (!seat->pointer_focus)
return;
GDK_NOTE (EVENTS,
g_message ("frame, seat %p", seat));
@@ -1724,6 +1731,9 @@ deliver_key_event (GdkWaylandSeat *seat,
GdkKeymap *keymap;
xkb_keysym_t sym;
guint delay, interval, timeout;
gint64 begin_time, now;
begin_time = g_get_monotonic_time ();
stop_key_repeat (seat);
@@ -1732,6 +1742,11 @@ deliver_key_event (GdkWaylandSeat *seat,
xkb_keymap = _gdk_wayland_keymap_get_xkb_keymap (keymap);
sym = xkb_state_key_get_one_sym (xkb_state, key);
if (sym == XKB_KEY_NoSymbol)
return;
if (sym == XKB_KEY_NoSymbol)
return;
seat->time = time_;
seat->key_modifiers = gdk_keymap_get_modifier_state (keymap);
@@ -1770,10 +1785,20 @@ deliver_key_event (GdkWaylandSeat *seat,
seat->repeat_count++;
seat->repeat_key = key;
interval *= 1000L;
delay *= 1000L;
now = g_get_monotonic_time ();
if (seat->repeat_count == 1)
timeout = delay;
seat->repeat_deadline = begin_time + delay;
else if (seat->repeat_deadline + interval > now)
seat->repeat_deadline += interval;
else
timeout = interval;
/* frame delay caused us to miss repeat deadline */
seat->repeat_deadline = now;
timeout = (seat->repeat_deadline - now) / 1000L;
seat->repeat_timer =
gdk_threads_add_timeout (timeout, keyboard_repeat, seat);
@@ -2736,7 +2761,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
if (native == NULL || GDK_WINDOW_DESTROYED (native))
return GDK_GRAB_NOT_VIEWABLE;
gdk_wayland_seat_set_grab_window (wayland_seat, window);
gdk_wayland_seat_set_grab_window (wayland_seat, native);
wayland_seat->pointer_grab_time = evtime;
if (prepare_func)
@@ -2755,9 +2780,9 @@ gdk_wayland_seat_grab (GdkSeat *seat,
{
GdkWindow *prev_focus = gdk_wayland_device_get_focus (wayland_seat->master_pointer);
if (prev_focus != window)
if (prev_focus != native)
device_emit_grab_crossing (wayland_seat->master_pointer, prev_focus,
window, GDK_CROSSING_GRAB, evtime);
native, GDK_CROSSING_GRAB, evtime);
_gdk_display_add_device_grab (display,
wayland_seat->master_pointer,
@@ -2780,9 +2805,9 @@ gdk_wayland_seat_grab (GdkSeat *seat,
{
GdkWindow *prev_focus = gdk_wayland_device_get_focus (wayland_seat->touch_master);
if (prev_focus != window)
if (prev_focus != native)
device_emit_grab_crossing (wayland_seat->touch_master, prev_focus,
window, GDK_CROSSING_GRAB, evtime);
native, GDK_CROSSING_GRAB, evtime);
_gdk_display_add_device_grab (display,
wayland_seat->touch_master,
@@ -2801,9 +2826,9 @@ gdk_wayland_seat_grab (GdkSeat *seat,
{
GdkWindow *prev_focus = gdk_wayland_device_get_focus (wayland_seat->master_keyboard);
if (prev_focus != window)
if (prev_focus != native)
device_emit_grab_crossing (wayland_seat->master_keyboard, prev_focus,
window, GDK_CROSSING_GRAB, evtime);
native, GDK_CROSSING_GRAB, evtime);
_gdk_display_add_device_grab (display,
wayland_seat->master_keyboard,
@@ -2893,11 +2918,11 @@ gdk_wayland_seat_get_slaves (GdkSeat *seat,
GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (seat);
GList *slaves = NULL;
if (capabilities & GDK_SEAT_CAPABILITY_POINTER)
if (wayland_seat->pointer && (capabilities & GDK_SEAT_CAPABILITY_POINTER))
slaves = g_list_prepend (slaves, wayland_seat->pointer);
if (capabilities & GDK_SEAT_CAPABILITY_KEYBOARD)
if (wayland_seat->keyboard && (capabilities & GDK_SEAT_CAPABILITY_KEYBOARD))
slaves = g_list_prepend (slaves, wayland_seat->keyboard);
if (capabilities & GDK_SEAT_CAPABILITY_TOUCH)
if (wayland_seat->touch && (capabilities & GDK_SEAT_CAPABILITY_TOUCH))
slaves = g_list_prepend (slaves, wayland_seat->touch);
return slaves;
@@ -2964,7 +2989,8 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
seat->data_device =
wl_data_device_manager_get_data_device (display_wayland->data_device_manager,
seat->wl_seat);
seat->drop_context = _gdk_wayland_drop_context_new (seat->data_device);
seat->drop_context = _gdk_wayland_drop_context_new (display,
seat->data_device);
wl_data_device_add_listener (seat->data_device,
&data_device_listener, seat);
+63 -11
View File
@@ -22,7 +22,11 @@
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#ifdef HAVE_LINUX_MEMFD_H
#include <linux/memfd.h>
#endif
#include <sys/mman.h>
#include <sys/syscall.h>
@@ -505,7 +509,13 @@ gdk_wayland_display_finalize (GObject *object)
static const gchar *
gdk_wayland_display_get_name (GdkDisplay *display)
{
return "Wayland";
const gchar *name;
name = g_getenv ("WAYLAND_DISPLAY");
if (name == NULL)
name = "wayland-0";
return name;
}
static GdkScreen *
@@ -945,6 +955,54 @@ typedef struct _GdkWaylandCairoSurfaceData {
uint32_t scale;
} GdkWaylandCairoSurfaceData;
static int
open_shared_memory (void)
{
static gboolean force_shm_open = FALSE;
int ret = -1;
#if !defined (__NR_memfd_create)
force_shm_open = TRUE;
#endif
do
{
#if defined (__NR_memfd_create)
if (!force_shm_open)
{
ret = syscall (__NR_memfd_create, "gdk-wayland", MFD_CLOEXEC);
/* fall back to shm_open until debian stops shipping 3.16 kernel
* See bug 766341
*/
if (ret < 0 && errno == ENOSYS)
force_shm_open = TRUE;
}
#endif
if (force_shm_open)
{
char name[NAME_MAX - 1] = "";
sprintf (name, "/gdk-wayland-%x", g_random_int ());
ret = shm_open (name, O_CREAT | O_EXCL | O_RDWR | O_CLOEXEC, 0600);
if (ret >= 0)
shm_unlink (name);
else if (errno == EEXIST)
continue;
}
}
while (ret < 0 && errno == EINTR);
if (ret < 0)
g_critical (G_STRLOC ": creating shared memory file (using %s) failed: %m",
force_shm_open? "shm_open" : "memfd_create");
return ret;
}
static struct wl_shm_pool *
create_shm_pool (struct wl_shm *shm,
int size,
@@ -952,19 +1010,13 @@ create_shm_pool (struct wl_shm *shm,
void **data_out)
{
struct wl_shm_pool *pool;
int ret, fd;
int fd;
void *data;
ret = syscall (__NR_memfd_create, "gdk-wayland", MFD_CLOEXEC);
fd = open_shared_memory ();
if (ret < 0)
{
g_critical (G_STRLOC ": creating shared memory file failed: %s",
g_strerror (-ret));
return NULL;
}
fd = ret;
if (fd < 0)
return NULL;
if (ftruncate (fd, size) < 0)
{
+3
View File
@@ -82,6 +82,9 @@ struct _GdkWaylandDisplay
GHashTable *known_globals;
GList *on_has_globals_closures;
/* Keep a list of orphaned dialogs (i.e. without parent) */
GList *orphan_dialogs;
struct wl_cursor_theme *scaled_cursor_themes[GDK_WAYLAND_THEME_SCALES_COUNT];
gchar *cursor_theme_name;
int cursor_theme_size;
+5 -2
View File
@@ -427,7 +427,7 @@ gdk_wayland_drag_context_action_changed (GdkDragContext *context,
{
GdkCursor *cursor;
cursor = gdk_drag_get_cursor (action);
cursor = gdk_drag_get_cursor (context, action);
gdk_drag_context_set_cursor (context, cursor);
}
@@ -528,6 +528,7 @@ _gdk_wayland_window_drag_begin (GdkWindow *window,
context_wayland = g_object_new (GDK_TYPE_WAYLAND_DRAG_CONTEXT, NULL);
context = GDK_DRAG_CONTEXT (context_wayland);
context->display = gdk_window_get_display (window);
context->source_window = g_object_ref (window);
context->is_source = TRUE;
context->targets = g_list_copy (targets);
@@ -552,13 +553,15 @@ _gdk_wayland_window_drag_begin (GdkWindow *window,
}
GdkDragContext *
_gdk_wayland_drop_context_new (struct wl_data_device *data_device)
_gdk_wayland_drop_context_new (GdkDisplay *display,
struct wl_data_device *data_device)
{
GdkWaylandDragContext *context_wayland;
GdkDragContext *context;
context_wayland = g_object_new (GDK_TYPE_WAYLAND_DRAG_CONTEXT, NULL);
context = GDK_DRAG_CONTEXT (context_wayland);
context->display = display;
context->is_source = FALSE;
return context;
+48 -19
View File
@@ -28,10 +28,9 @@ typedef struct _GdkWaylandEventSource {
GPollFD pfd;
uint32_t mask;
GdkDisplay *display;
gboolean reading;
} GdkWaylandEventSource;
static GList *event_sources = NULL;
static gboolean
gdk_event_source_prepare (GSource *base,
gint *timeout)
@@ -46,17 +45,26 @@ gdk_event_source_prepare (GSource *base,
/* We have to add/remove the GPollFD if we want to update our
* poll event mask dynamically. Instead, let's just flush all
* write on idle instead, which is what this amounts to. */
* write on idle instead, which is what this amounts to.
*/
if (_gdk_event_queue_find_first (source->display) != NULL)
return TRUE;
/* wl_display_prepare_read() needs to be balanced with either
* wl_display_read_events() or wl_display_cancel_read()
* (in gdk_event_source_check() */
if (source->reading)
return FALSE;
/* if prepare_read() returns non-zero, there are events to be dispatched */
if (wl_display_prepare_read (display->wl_display) != 0)
return TRUE;
source->reading = TRUE;
if (wl_display_flush (display->wl_display) < 0)
g_error ("Error flushing display: %s", g_strerror (errno));
if (wl_display_dispatch_pending (display->wl_display) < 0)
g_error ("Error dispatching display: %s", g_strerror (errno));
return FALSE;
}
@@ -64,9 +72,29 @@ static gboolean
gdk_event_source_check (GSource *base)
{
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
GdkWaylandDisplay *display_wayland = (GdkWaylandDisplay *) source->display;
if (source->display->event_pause_count > 0)
return _gdk_event_queue_find_first (source->display) != NULL;
{
if (source->reading)
wl_display_cancel_read (display_wayland->wl_display);
source->reading = FALSE;
return _gdk_event_queue_find_first (source->display) != NULL;
}
/* read the events from the wayland fd into their respective queues if we have data */
if (source->reading)
{
if (source->pfd.revents & G_IO_IN)
{
if (wl_display_read_events (display_wayland->wl_display) < 0)
g_error ("Error reading events from display: %s", g_strerror (errno));
}
else
wl_display_cancel_read (display_wayland->wl_display);
source->reading = FALSE;
}
return _gdk_event_queue_find_first (source->display) != NULL ||
source->pfd.revents;
@@ -98,9 +126,14 @@ gdk_event_source_dispatch (GSource *base,
}
static void
gdk_event_source_finalize (GSource *source)
gdk_event_source_finalize (GSource *base)
{
event_sources = g_list_remove (event_sources, source);
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
GdkWaylandDisplay *display = (GdkWaylandDisplay *) source->display;
if (source->reading)
wl_display_cancel_read (display->wl_display);
source->reading = FALSE;
}
static GSourceFuncs wl_glib_source_funcs = {
@@ -131,7 +164,8 @@ _gdk_wayland_display_event_source_new (GdkDisplay *display)
source = g_source_new (&wl_glib_source_funcs,
sizeof (GdkWaylandEventSource));
name = g_strdup_printf ("GDK Wayland Event source (%s)", "display name");
name = g_strdup_printf ("GDK Wayland Event source (%s)",
gdk_display_get_name (display));
g_source_set_name (source, name);
g_free (name);
wl_source = (GdkWaylandEventSource *) source;
@@ -146,8 +180,6 @@ _gdk_wayland_display_event_source_new (GdkDisplay *display)
g_source_set_can_recurse (source, TRUE);
g_source_attach (source, NULL);
event_sources = g_list_prepend (event_sources, source);
return source;
}
@@ -160,14 +192,11 @@ _gdk_wayland_display_queue_events (GdkDisplay *display)
display_wayland = GDK_WAYLAND_DISPLAY (display);
source = (GdkWaylandEventSource *) display_wayland->event_source;
if (source->pfd.revents & G_IO_IN)
if (wl_display_dispatch_pending (display_wayland->wl_display) < 0)
{
if (wl_display_dispatch (display_wayland->wl_display) < 0)
{
g_warning ("Error %d (%s) dispatching to Wayland display.",
errno, g_strerror (errno));
exit (1);
}
g_warning ("Error %d (%s) dispatching to Wayland display.",
errno, g_strerror (errno));
exit (1);
}
if (source->pfd.revents & (G_IO_ERR | G_IO_HUP))
+51 -3
View File
@@ -351,7 +351,7 @@ gdk_wayland_keymap_translate_keyboard_state (GdkKeymap *keymap,
if (consumed_modifiers)
*consumed_modifiers = get_gdk_modifiers (xkb_keymap, consumed);
return TRUE;
return (sym != XKB_KEY_NoSymbol);
}
static guint
@@ -370,14 +370,62 @@ static void
gdk_wayland_keymap_add_virtual_modifiers (GdkKeymap *keymap,
GdkModifierType *state)
{
return;
struct xkb_keymap *xkb_keymap;
struct xkb_state *xkb_state;
xkb_mod_index_t idx;
uint32_t mods, real;
struct { const char *name; GdkModifierType mask; } vmods[] = {
{ "Super", GDK_SUPER_MASK },
{ "Hyper", GDK_HYPER_MASK },
{ "Meta", GDK_META_MASK },
{ NULL, 0 }
};
int i;
xkb_keymap = GDK_WAYLAND_KEYMAP (keymap)->xkb_keymap;
mods = get_xkb_modifiers (xkb_keymap, *state);
xkb_state = xkb_state_new (xkb_keymap);
for (i = 0; vmods[i].name; i++)
{
idx = xkb_keymap_mod_get_index (xkb_keymap, vmods[i].name);
if (idx == XKB_MOD_INVALID)
continue;
xkb_state_update_mask (xkb_state, 1 << idx, 0, 0, 0, 0, 0);
real = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_EFFECTIVE);
real &= 0xf0; /* ignore mapping to Lock, Shift, Control, Mod1 */
if (mods & real)
*state |= vmods[i].mask;
xkb_state_update_mask (xkb_state, 0, 0, 0, 0, 0, 0);
}
xkb_state_unref (xkb_state);
}
static gboolean
gdk_wayland_keymap_map_virtual_modifiers (GdkKeymap *keymap,
GdkModifierType *state)
{
return TRUE;
struct xkb_keymap *xkb_keymap;
struct xkb_state *xkb_state;
uint32_t mods, mapped;
gboolean ret = TRUE;
xkb_keymap = GDK_WAYLAND_KEYMAP (keymap)->xkb_keymap;
mods = get_xkb_modifiers (xkb_keymap, *state);
xkb_state = xkb_state_new (xkb_keymap);
xkb_state_update_mask (xkb_state, mods & ~0xff, 0, 0, 0, 0, 0);
mapped = xkb_state_serialize_mods (xkb_state, XKB_STATE_MODS_EFFECTIVE);
if ((mapped & mods & 0xff) != 0)
ret = FALSE;
*state |= get_gdk_modifiers (xkb_keymap, mapped);
xkb_state_unref (xkb_state);
return ret;
}
static void
+2 -1
View File
@@ -109,7 +109,8 @@ GdkDragContext *_gdk_wayland_window_drag_begin (GdkWindow *window,
void _gdk_wayland_window_offset_next_wl_buffer (GdkWindow *window,
int x,
int y);
GdkDragContext * _gdk_wayland_drop_context_new (struct wl_data_device *data_device);
GdkDragContext * _gdk_wayland_drop_context_new (GdkDisplay *display,
struct wl_data_device *data_device);
void _gdk_wayland_drag_context_set_source_window (GdkDragContext *context,
GdkWindow *window);
void _gdk_wayland_drag_context_set_dest_window (GdkDragContext *context,
+8 -7
View File
@@ -301,13 +301,7 @@ gdk_wayland_screen_is_composited (GdkScreen *screen)
static gchar *
gdk_wayland_screen_make_display_name (GdkScreen *screen)
{
const gchar *name;
name = g_getenv ("WAYLAND_DISPLAY");
if (name == NULL)
name = "wayland-0";
return g_strdup (name);
return g_strdup (gdk_display_get_name (GDK_WAYLAND_SCREEN (screen)->display));
}
static GdkWindow *
@@ -626,6 +620,8 @@ init_settings (GdkScreen *screen)
screen_wayland->settings = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref);
source = g_settings_schema_source_get_default ();
if (source == NULL)
return;
for (i = 0; i < G_N_ELEMENTS (translations); i++)
{
@@ -921,6 +917,8 @@ gdk_wayland_screen_list_visuals (GdkScreen *screen)
#define GDK_TYPE_WAYLAND_VISUAL (_gdk_wayland_visual_get_type ())
#define GDK_WAYLAND_VISUAL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_VISUAL, GdkWaylandVisual))
/* Currently, the Wayland backend only ever uses ARGB8888.
*/
static GdkVisual *
gdk_wayland_visual_new (GdkScreen *screen)
{
@@ -930,6 +928,9 @@ gdk_wayland_visual_new (GdkScreen *screen)
visual->screen = GDK_SCREEN (screen);
visual->type = GDK_VISUAL_TRUE_COLOR;
visual->depth = 32;
visual->red_mask = 0xff0000;
visual->green_mask = 0x00ff00;
visual->blue_mask = 0x0000ff;
visual->bits_per_rgb = 8;
return visual;
+119 -39
View File
@@ -35,6 +35,7 @@
#include <string.h>
typedef struct _SelectionBuffer SelectionBuffer;
typedef struct _SelectionData SelectionData;
typedef struct _StoredSelection StoredSelection;
typedef struct _AsyncWriteData AsyncWriteData;
typedef struct _DataOfferData DataOfferData;
@@ -80,22 +81,26 @@ struct _AsyncWriteData
gsize index;
};
struct _SelectionData
{
DataOfferData *offer;
GHashTable *buffers; /* Hashtable of target_atom->SelectionBuffer */
};
enum {
ATOM_PRIMARY,
ATOM_CLIPBOARD,
ATOM_DND
ATOM_DND,
N_ATOMS
};
static GdkAtom atoms[3] = { 0 };
static GdkAtom atoms[N_ATOMS] = { 0 };
struct _GdkWaylandSelection
{
/* Destination-side data */
DataOfferData *dnd_offer;
DataOfferData *clipboard_offer;
DataOfferData *primary_offer;
SelectionData selections[N_ATOMS];
GHashTable *offers; /* Currently alive offers, Hashtable of wl_data_offer->DataOfferData */
GHashTable *selection_buffers; /* Hashtable of target_atom->SelectionBuffer */
/* Source-side data */
StoredSelection stored_selection;
@@ -307,6 +312,7 @@ GdkWaylandSelection *
gdk_wayland_selection_new (void)
{
GdkWaylandSelection *selection;
gint i;
/* init atoms */
atoms[ATOM_PRIMARY] = gdk_atom_intern_static_string ("PRIMARY");
@@ -314,9 +320,13 @@ gdk_wayland_selection_new (void)
atoms[ATOM_DND] = gdk_atom_intern_static_string ("GdkWaylandSelection");
selection = g_new0 (GdkWaylandSelection, 1);
selection->selection_buffers =
g_hash_table_new_full (NULL, NULL, NULL,
(GDestroyNotify) selection_buffer_cancel_and_unref);
for (i = 0; i < G_N_ELEMENTS (selection->selections); i++)
{
selection->selections[i].buffers =
g_hash_table_new_full (NULL, NULL, NULL,
(GDestroyNotify) selection_buffer_cancel_and_unref);
}
selection->offers =
g_hash_table_new_full (NULL, NULL, NULL,
(GDestroyNotify) data_offer_data_free);
@@ -328,7 +338,11 @@ gdk_wayland_selection_new (void)
void
gdk_wayland_selection_free (GdkWaylandSelection *selection)
{
g_hash_table_destroy (selection->selection_buffers);
gint i;
for (i = 0; i < G_N_ELEMENTS (selection->selections); i++)
g_hash_table_destroy (selection->selections[i].buffers);
g_array_unref (selection->source_targets);
g_hash_table_destroy (selection->offers);
@@ -456,16 +470,16 @@ static const struct gtk_primary_selection_offer_listener primary_offer_listener
primary_offer_offer,
};
DataOfferData *
SelectionData *
selection_lookup_offer_by_atom (GdkWaylandSelection *selection,
GdkAtom selection_atom)
{
if (selection_atom == atoms[ATOM_PRIMARY])
return selection->primary_offer;
return &selection->selections[ATOM_PRIMARY];
else if (selection_atom == atoms[ATOM_CLIPBOARD])
return selection->clipboard_offer;
return &selection->selections[ATOM_CLIPBOARD];
else if (selection_atom == atoms[ATOM_DND])
return selection->dnd_offer;
return &selection->selections[ATOM_DND];
else
return NULL;
}
@@ -517,6 +531,7 @@ gdk_wayland_selection_set_offer (GdkDisplay *display,
{
GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
struct wl_data_offer *prev_offer;
SelectionData *selection_data;
DataOfferData *info;
info = g_hash_table_lookup (selection->offers, wl_offer);
@@ -526,15 +541,14 @@ gdk_wayland_selection_set_offer (GdkDisplay *display,
if (prev_offer)
g_hash_table_remove (selection->offers, prev_offer);
if (selection_atom == atoms[ATOM_PRIMARY])
selection->primary_offer = info;
else if (selection_atom == atoms[ATOM_CLIPBOARD])
selection->clipboard_offer = info;
else if (selection_atom == atoms[ATOM_DND])
selection->dnd_offer = info;
selection_data = selection_lookup_offer_by_atom (selection, selection_atom);
/* Clear all buffers */
g_hash_table_remove_all (selection->selection_buffers);
if (selection_data)
{
selection_data->offer = info;
/* Clear all buffers */
g_hash_table_remove_all (selection_data->buffers);
}
}
gpointer
@@ -542,12 +556,12 @@ gdk_wayland_selection_get_offer (GdkDisplay *display,
GdkAtom selection_atom)
{
GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
const DataOfferData *info;
const SelectionData *data;
info = selection_lookup_offer_by_atom (selection, selection_atom);
data = selection_lookup_offer_by_atom (selection, selection_atom);
if (info)
return info->offer_data;
if (data && data->offer)
return data->offer->offer_data;
return NULL;
}
@@ -557,12 +571,12 @@ gdk_wayland_selection_get_targets (GdkDisplay *display,
GdkAtom selection_atom)
{
GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
const DataOfferData *info;
const SelectionData *data;
info = selection_lookup_offer_by_atom (selection, selection_atom);
data = selection_lookup_offer_by_atom (selection, selection_atom);
if (info)
return info->targets;
if (data && data->offer)
return data->offer->targets;
return NULL;
}
@@ -749,13 +763,17 @@ gdk_wayland_selection_lookup_requestor_buffer (GdkWindow *requestor)
GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
SelectionBuffer *buffer_data;
GHashTableIter iter;
gint i;
g_hash_table_iter_init (&iter, selection->selection_buffers);
while (g_hash_table_iter_next (&iter, NULL, (gpointer*) &buffer_data))
for (i = 0; i < G_N_ELEMENTS (selection->selections); i++)
{
if (g_list_find (buffer_data->requestors, requestor))
return buffer_data;
g_hash_table_iter_init (&iter, selection->selections[i].buffers);
while (g_hash_table_iter_next (&iter, NULL, (gpointer*) &buffer_data))
{
if (g_list_find (buffer_data->requestors, requestor))
return buffer_data;
}
}
return NULL;
@@ -1255,11 +1273,16 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
guint32 time)
{
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
const SelectionData *selection_data;
SelectionBuffer *buffer_data;
gpointer offer;
gchar *mimetype;
GList *target_list;
selection_data = selection_lookup_offer_by_atom (wayland_selection, selection);
if (!selection_data)
return;
offer = gdk_wayland_selection_get_offer (display, selection);
target_list = gdk_wayland_selection_get_targets (display, selection);
@@ -1285,8 +1308,7 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
mimetype);
}
buffer_data = g_hash_table_lookup (wayland_selection->selection_buffers,
target);
buffer_data = g_hash_table_lookup (selection_data->buffers, target);
if (buffer_data)
selection_buffer_add_requestor (buffer_data, requestor);
@@ -1333,7 +1355,7 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
g_free (targets);
}
g_hash_table_insert (wayland_selection->selection_buffers,
g_hash_table_insert (selection_data->buffers,
GDK_ATOM_TO_POINTER (target),
buffer_data);
}
@@ -1385,11 +1407,69 @@ _gdk_wayland_display_text_property_to_utf8_list (GdkDisplay *display,
return nitems;
}
/* This function has been copied straight from the x11 backend */
static gchar *
sanitize_utf8 (const gchar *src,
gboolean return_latin1)
{
gint len = strlen (src);
GString *result = g_string_sized_new (len);
const gchar *p = src;
while (*p)
{
if (*p == '\r')
{
p++;
if (*p == '\n')
p++;
g_string_append_c (result, '\n');
}
else
{
gunichar ch = g_utf8_get_char (p);
if (!((ch < 0x20 && ch != '\t' && ch != '\n') || (ch >= 0x7f && ch < 0xa0)))
{
if (return_latin1)
{
if (ch <= 0xff)
g_string_append_c (result, ch);
else
g_string_append_printf (result,
ch < 0x10000 ? "\\u%04x" : "\\U%08x",
ch);
}
else
{
char buf[7];
gint buflen;
buflen = g_unichar_to_utf8 (ch, buf);
g_string_append_len (result, buf, buflen);
}
}
p = g_utf8_next_char (p);
}
}
return g_string_free (result, FALSE);
}
gchar *
_gdk_wayland_display_utf8_to_string_target (GdkDisplay *display,
const gchar *str)
{
return NULL;
/* This is mainly needed when interfacing with old clients through
* Xwayland, the STRING target could be used, and passed as-is
* by the compositor.
*
* There's already some handling of this atom (aka "mimetype" in
* this backend) in common code, so we end up in this vfunc.
*/
return sanitize_utf8 (str, TRUE);
}
void
+45 -16
View File
@@ -168,10 +168,10 @@ struct _GdkWindowImplWaylandClass
GdkWindowImplClass parent_class;
};
static void gdk_wayland_window_configure (GdkWindow *window,
int width,
int height,
int scale);
static void gdk_wayland_window_maybe_configure (GdkWindow *window,
int width,
int height,
int scale);
static void maybe_set_gtk_surface_dbus_properties (GdkWindow *window);
static void maybe_set_gtk_surface_modal (GdkWindow *window);
@@ -191,14 +191,15 @@ _gdk_window_impl_wayland_init (GdkWindowImplWayland *impl)
impl->saved_height = -1;
}
/* Keep a list of orphaned dialogs (i.e. without parent) */
static GList *orphan_dialogs;
static void
_gdk_wayland_screen_add_orphan_dialog (GdkWindow *window)
{
if (!g_list_find (orphan_dialogs, window))
orphan_dialogs = g_list_prepend (orphan_dialogs, window);
GdkWaylandDisplay *display_wayland =
GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
if (!g_list_find (display_wayland->orphan_dialogs, window))
display_wayland->orphan_dialogs =
g_list_prepend (display_wayland->orphan_dialogs, window);
}
static void
@@ -571,7 +572,7 @@ window_update_scale (GdkWindow *window)
}
/* Notify app that scale changed */
gdk_wayland_window_configure (window, window->width, window->height, scale);
gdk_wayland_window_maybe_configure (window, window->width, window->height, scale);
}
static void
@@ -926,6 +927,22 @@ gdk_wayland_window_configure (GdkWindow *window,
_gdk_wayland_display_deliver_event (display, event);
}
static void
gdk_wayland_window_maybe_configure (GdkWindow *window,
int width,
int height,
int scale)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
if (window->width == width &&
window->height == height &&
impl->scale == scale)
return;
gdk_wayland_window_configure (window, width, height, scale);
}
static void
gdk_wayland_window_sync_parent (GdkWindow *window,
GdkWindow *parent)
@@ -934,6 +951,9 @@ gdk_wayland_window_sync_parent (GdkWindow *window,
GdkWindowImplWayland *impl_parent = NULL;
struct xdg_surface *parent_surface;
g_assert (parent == NULL ||
gdk_window_get_display (window) == gdk_window_get_display (parent));
if (!impl->display_server.xdg_surface)
return;
@@ -959,12 +979,14 @@ gdk_wayland_window_sync_parent (GdkWindow *window,
static void
gdk_wayland_window_update_dialogs (GdkWindow *window)
{
GdkWaylandDisplay *display_wayland =
GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
GList *l;
if (!orphan_dialogs)
if (!display_wayland->orphan_dialogs)
return;
for (l = orphan_dialogs; l; l = l->next)
for (l = display_wayland->orphan_dialogs; l; l = l->next)
{
GdkWindow *w = l->data;
GdkWindowImplWayland *impl;
@@ -1811,7 +1833,8 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
impl->display_server.outputs = NULL;
if (impl->hint == GDK_WINDOW_TYPE_HINT_DIALOG && !impl->transient_for)
orphan_dialogs = g_list_remove (orphan_dialogs, window);
display_wayland->orphan_dialogs =
g_list_remove (display_wayland->orphan_dialogs, window);
}
_gdk_wayland_window_clear_saved_size (window);
@@ -1936,7 +1959,7 @@ gdk_window_wayland_move_resize (GdkWindow *window,
* just move the window - don't update its size
*/
if (width > 0 && height > 0)
gdk_wayland_window_configure (window, width, height, impl->scale);
gdk_wayland_window_maybe_configure (window, width, height, impl->scale);
}
static void
@@ -2272,8 +2295,13 @@ gdk_wayland_window_set_transient_for (GdkWindow *window,
GdkWindow *parent)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkWaylandDisplay *display_wayland =
GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
GdkWindow *previous_parent;
g_assert (parent == NULL ||
gdk_window_get_display (window) == gdk_window_get_display (parent));
if (check_transient_for_loop (window, parent))
{
g_warning ("Setting %p transient for %p would create a loop", window, parent);
@@ -2291,7 +2319,8 @@ gdk_wayland_window_set_transient_for (GdkWindow *window,
if (!parent)
_gdk_wayland_screen_add_orphan_dialog (window);
else if (!previous_parent)
orphan_dialogs = g_list_remove (orphan_dialogs, window);
display_wayland->orphan_dialogs =
g_list_remove (display_wayland->orphan_dialogs, window);
}
gdk_wayland_window_sync_parent (window, NULL);
if (should_map_as_subsurface (window) &&
@@ -2744,7 +2773,7 @@ gdk_wayland_window_set_shadow_width (GdkWindow *window,
(impl->margin_left + impl->margin_right) + (left + right);
new_height = window->height -
(impl->margin_top + impl->margin_bottom) + (top + bottom);
gdk_wayland_window_configure (window, new_width, new_height, impl->scale);
gdk_wayland_window_maybe_configure (window, new_width, new_height, impl->scale);
impl->margin_left = left;
impl->margin_right = right;
+1
View File
@@ -182,6 +182,7 @@ gdk_drag_context_new (GdkDisplay *display)
context_win32 = g_object_new (GDK_TYPE_WIN32_DRAG_CONTEXT, NULL);
context = GDK_DRAG_CONTEXT(context_win32);
context->display = display;
gdk_drag_context_set_device (context, gdk_seat_get_pointer (gdk_display_get_default_seat (display)));
+98 -3
View File
@@ -1053,17 +1053,17 @@ show_window_recurse (GdkWindow *window, gboolean hide_window)
{
if (gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED)
{
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMAXIMIZED);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMAXIMIZED);
}
else
{
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
}
}
}
else
{
ShowWindow (GDK_WINDOW_HWND (window), SW_MINIMIZE);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_MINIMIZE);
}
}
@@ -1907,6 +1907,77 @@ ensure_stacking_on_activate_app (MSG *msg,
}
}
static gboolean
handle_wm_sysmenu (GdkWindow *window, MSG *msg, gint *ret_valp)
{
GdkWindowImplWin32 *impl;
LONG_PTR style, tmp_style;
gboolean maximized, minimized;
LONG_PTR additional_styles;
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
style = GetWindowLongPtr (msg->hwnd, GWL_STYLE);
maximized = IsZoomed (msg->hwnd);
minimized = IsIconic (msg->hwnd);
additional_styles = 0;
if (!(style & WS_SYSMENU))
additional_styles |= WS_SYSMENU;
if (!maximized && !(style & WS_MAXIMIZEBOX))
additional_styles |= WS_MAXIMIZEBOX;
if (!minimized && !(style & WS_MINIMIZEBOX))
additional_styles |= WS_MINIMIZEBOX;
if (!minimized && !maximized && !(style & WS_SIZEBOX))
additional_styles |= WS_SIZEBOX;
if (additional_styles == 0)
/* The caller will eventually pass this to DefWindowProc (),
* only without the style dance, which isn't needed, as it turns out.
*/
return FALSE;
/* Note: This code will enable resizing, maximizing and minimizing windows
* via window menu even if these are non-CSD windows that were explicitly
* forbidden from doing this by removing the appropriate styles,
* or if these are CSD windows that were explicitly forbidden from doing
* this by removing appropriate decorations from the headerbar and/or
* changing hints or properties.
*
* If doing this for non-CSD windows is not desired,
* do a _gdk_win32_window_lacks_wm_decorations() check and return FALSE
* if it doesn't pass.
*
* If doing this for CSD windows with disabled decorations is not desired,
* tough luck - GDK can't know which CSD decorations are enabled, and which
* are not.
*
* If doing this for CSD windows with particular hints is not desired,
* check window hints here and return FALSE (DefWindowProc() will return
* FALSE later) or set *ret_valp to 0 and return TRUE.
*/
tmp_style = style | additional_styles;
GDK_NOTE (EVENTS, g_print (" Handling WM_SYSMENU: style 0x%lx -> 0x%lx\n", style, tmp_style));
impl->have_temp_styles = TRUE;
impl->temp_styles = additional_styles;
SetWindowLongPtr (msg->hwnd, GWL_STYLE, tmp_style);
*ret_valp = DefWindowProc (msg->hwnd, msg->message, msg->wParam, msg->lParam);
tmp_style = GetWindowLongPtr (msg->hwnd, GWL_STYLE);
style = tmp_style & ~additional_styles;
GDK_NOTE (EVENTS, g_print (" Handling WM_SYSMENU: style 0x%lx <- 0x%lx\n", style, tmp_style));
SetWindowLongPtr (msg->hwnd, GWL_STYLE, style);
impl->have_temp_styles = FALSE;
return TRUE;
}
gboolean
_gdk_win32_window_fill_min_max_info (GdkWindow *window,
MINMAXINFO *mmi)
@@ -2856,6 +2927,30 @@ gdk_event_translate (MSG *msg,
}
break;
case WM_SYSMENU:
return_val = handle_wm_sysmenu (window, msg, ret_valp);
break;
case WM_INITMENU:
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (impl->have_temp_styles)
{
LONG_PTR window_style;
window_style = GetWindowLongPtr (GDK_WINDOW_HWND (window),
GWL_STYLE);
/* Handling WM_SYSMENU added extra styles to this window,
* remove them now.
*/
window_style &= ~impl->temp_styles;
SetWindowLongPtr (GDK_WINDOW_HWND (window),
GWL_STYLE,
window_style);
}
break;
case WM_SYSCOMMAND:
switch (msg->wParam)
{
+15
View File
@@ -97,6 +97,18 @@
#define WM_MOUSEHWHEEL 0x20E
#endif
/* According to
* http://blog.airesoft.co.uk/2009/11/wm_messages/
* this is the actual internal name MS uses for this undocumented message.
* According to
* https://bugs.winehq.org/show_bug.cgi?id=15055
* wParam is 0
* lParam is a pair of virtual desktop coordinates for the popup
*/
#ifndef WM_SYSMENU
#define WM_SYSMENU 0x313
#endif
#ifndef CF_DIBV5
#define CF_DIBV5 17
#endif
@@ -537,6 +549,9 @@ gboolean _gdk_win32_window_fill_min_max_info (GdkWindow *window,
gboolean _gdk_win32_window_lacks_wm_decorations (GdkWindow *window);
BOOL WINAPI GtkShowWindow (HWND hwnd,
int cmd_show);
/* Initialization */
void _gdk_win32_windowing_init (void);
void _gdk_dnd_init (void);
+38 -50
View File
@@ -38,7 +38,7 @@ struct _GdkWin32Screen
GdkScreen parent_instance;
gint num_monitors;
GdkWin32Monitor *monitors;
GdkWin32Monitor **monitors;
GdkVisual *system_visual;
GdkVisual *rgba_visual;
@@ -57,6 +57,15 @@ struct _GdkWin32ScreenClass
G_DEFINE_TYPE (GdkWin32Screen, gdk_win32_screen, GDK_TYPE_SCREEN)
static void
free_monitor (gpointer user_data)
{
GdkWin32Monitor *monitor = (GdkWin32Monitor *)user_data;
g_free (monitor->name);
g_free (monitor);
}
static gint
get_color_precision (gulong mask)
{
@@ -263,9 +272,9 @@ init_root_window_size (GdkWin32Screen *screen)
GdkRectangle rect;
int i;
rect = screen->monitors[0].rect;
rect = screen->monitors[0]->rect;
for (i = 1; i < screen->num_monitors; i++)
gdk_rectangle_union (&rect, &screen->monitors[i].rect, &rect);
gdk_rectangle_union (&rect, &screen->monitors[i]->rect, &rect);
screen->root_window->width = rect.width;
screen->root_window->height = rect.height;
@@ -309,22 +318,9 @@ init_root_window (GdkWin32Screen *screen_win32)
GDK_NOTE (MISC, g_print ("screen->root_window=%p\n", window));
}
static BOOL CALLBACK
count_monitor (HMONITOR hmonitor,
HDC hdc,
LPRECT rect,
LPARAM data)
{
gint *n = (gint *) data;
(*n)++;
return TRUE;
}
typedef struct {
GdkWin32Screen *screen;
gint index;
GPtrArray *monitors;
} EnumMonitorData;
static BOOL CALLBACK
@@ -352,10 +348,6 @@ enum_monitor (HMONITOR hmonitor,
MONITORINFOEXA2 monitor_info;
HDC hDC;
g_assert (data->index < data->screen->num_monitors);
monitor = data->screen->monitors + data->index;
monitor_info.cbSize = sizeof (MONITORINFOEXA2);
GetMonitorInfoA (hmonitor, (MONITORINFO *) &monitor_info);
@@ -363,6 +355,7 @@ enum_monitor (HMONITOR hmonitor,
#define MONITORINFOF_PRIMARY 1
#endif
monitor = g_new0 (GdkWin32Monitor, 1);
monitor->name = g_strdup (monitor_info.szDevice);
hDC = CreateDCA ("DISPLAY", monitor_info.szDevice, NULL, NULL);
monitor->width_mm = GetDeviceCaps (hDC, HORZSIZE);
@@ -377,17 +370,13 @@ enum_monitor (HMONITOR hmonitor,
monitor->work_rect.width = monitor_info.rcWork.right - monitor_info.rcWork.left;
monitor->work_rect.height = monitor_info.rcWork.bottom - monitor_info.rcWork.top;
if (monitor_info.dwFlags & MONITORINFOF_PRIMARY && data->index != 0)
{
/* Put primary monitor at index 0, just in case somebody needs
* to know which one is the primary.
*/
GdkWin32Monitor temp = *monitor;
*monitor = data->screen->monitors[0];
data->screen->monitors[0] = temp;
}
data->index++;
if (monitor_info.dwFlags & MONITORINFOF_PRIMARY)
/* Put primary monitor at index 0, just in case somebody needs
* to know which one is the primary.
*/
g_ptr_array_insert (data->monitors, 0, monitor);
else
g_ptr_array_add (data->monitors, monitor);
return TRUE;
}
@@ -395,27 +384,27 @@ enum_monitor (HMONITOR hmonitor,
static void
init_monitors (GdkWin32Screen *screen)
{
gint count;
EnumMonitorData data;
gint i;
count = 0;
EnumDisplayMonitors (NULL, NULL, count_monitor, (LPARAM) &count);
screen->num_monitors = count;
screen->monitors = g_renew (GdkWin32Monitor, screen->monitors, screen->num_monitors);
data.screen = screen;
data.index = 0;
data.monitors = g_ptr_array_new ();
for (i = 0; i < screen->num_monitors; i++)
free_monitor (screen->monitors[i]);
EnumDisplayMonitors (NULL, NULL, enum_monitor, (LPARAM) &data);
screen->num_monitors = data.monitors->len;
screen->monitors = (GdkWin32Monitor **)g_ptr_array_free (data.monitors, FALSE);
_gdk_offset_x = G_MININT;
_gdk_offset_y = G_MININT;
/* Calculate offset */
for (i = 0; i < screen->num_monitors; i++)
{
GdkRectangle *rect = &screen->monitors[i].rect;
GdkRectangle *rect = &screen->monitors[i]->rect;
_gdk_offset_x = MAX (_gdk_offset_x, -rect->x);
_gdk_offset_y = MAX (_gdk_offset_y, -rect->y);
}
@@ -426,10 +415,10 @@ init_monitors (GdkWin32Screen *screen)
for (i = 0; i < screen->num_monitors; i++)
{
GdkRectangle *rect;
rect = &screen->monitors[i].rect;
rect = &screen->monitors[i]->rect;
rect->x += _gdk_offset_x;
rect->y += _gdk_offset_y;
rect = &screen->monitors[i].work_rect;
rect = &screen->monitors[i]->work_rect;
rect->x += _gdk_offset_x;
rect->y += _gdk_offset_y;
GDK_NOTE (MISC, g_print ("Monitor %d: %dx%d@%+d%+d\n", i,
@@ -546,7 +535,7 @@ gdk_win32_screen_get_monitor_width_mm (GdkScreen *screen,
g_return_val_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()), 0);
g_return_val_if_fail (num_monitor < win32_screen->num_monitors, 0);
return win32_screen->monitors[num_monitor].width_mm;
return win32_screen->monitors[num_monitor]->width_mm;
}
static gint
@@ -558,7 +547,7 @@ gdk_win32_screen_get_monitor_height_mm (GdkScreen *screen,
g_return_val_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()), 0);
g_return_val_if_fail (num_monitor < win32_screen->num_monitors, 0);
return win32_screen->monitors[num_monitor].height_mm;
return win32_screen->monitors[num_monitor]->height_mm;
}
static gchar *
@@ -570,7 +559,7 @@ gdk_win32_screen_get_monitor_plug_name (GdkScreen *screen,
g_return_val_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()), NULL);
g_return_val_if_fail (num_monitor < win32_screen->num_monitors, NULL);
return g_strdup (win32_screen->monitors[num_monitor].name);
return g_strdup (win32_screen->monitors[num_monitor]->name);
}
static void
@@ -583,7 +572,7 @@ gdk_win32_screen_get_monitor_geometry (GdkScreen *screen,
g_return_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()));
g_return_if_fail (num_monitor < win32_screen->num_monitors);
*dest = win32_screen->monitors[num_monitor].rect;
*dest = win32_screen->monitors[num_monitor]->rect;
}
static void
@@ -596,7 +585,7 @@ gdk_win32_screen_get_monitor_workarea (GdkScreen *screen,
g_return_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()));
g_return_if_fail (num_monitor < win32_screen->num_monitors);
*dest = win32_screen->monitors[num_monitor].work_rect;
*dest = win32_screen->monitors[num_monitor]->work_rect;
}
static gint
@@ -754,8 +743,7 @@ gdk_win32_screen_finalize (GObject *object)
gint i;
for (i = 0; i < screen->num_monitors; i++)
g_free (screen->monitors[i].name);
g_free (screen->monitors);
free_monitor (screen->monitors[i]);
G_OBJECT_CLASS (gdk_win32_screen_parent_class)->finalize (object);
}
+122 -18
View File
@@ -643,7 +643,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
/* check consistency of redundant information */
guint remaining_mask = attributes_mask;
g_return_if_fail (display == gdk_display_get_default ());
g_return_if_fail (display == _gdk_display);
GDK_NOTE (MISC,
g_print ("_gdk_window_impl_new: %s %s\n",
@@ -1145,7 +1145,7 @@ show_window_internal (GdkWindow *window,
!already_mapped &&
(window->state & GDK_WINDOW_STATE_ICONIFIED))
{
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMINNOACTIVE);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMINNOACTIVE);
return;
}
@@ -1318,29 +1318,29 @@ show_window_internal (GdkWindow *window,
}
else if (window->state & GDK_WINDOW_STATE_MAXIMIZED)
{
ShowWindow (GDK_WINDOW_HWND (window), SW_MAXIMIZE);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_MAXIMIZE);
}
else if (window->state & GDK_WINDOW_STATE_ICONIFIED)
{
if (focus_on_map)
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
else
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNOACTIVATE);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNOACTIVATE);
}
else if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP || !focus_on_map)
{
if (!IsWindowVisible (GDK_WINDOW_HWND (window)))
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNOACTIVATE);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNOACTIVATE);
else
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNA);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNA);
}
else if (!IsWindowVisible (GDK_WINDOW_HWND (window)))
{
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
}
else
{
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOW);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOW);
}
/* Sync STATE_ABOVE to TOPMOST */
@@ -1395,7 +1395,7 @@ gdk_win32_window_hide (GdkWindow *window)
}
else
{
ShowWindow (GDK_WINDOW_HWND (window), SW_HIDE);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_HIDE);
}
}
@@ -2785,7 +2785,7 @@ _gdk_win32_window_update_style_bits (GdkWindow *window)
}
SetWindowPos (GDK_WINDOW_HWND (window), insert_after,
0, 0,
rect.left, rect.top,
rect.right - rect.left, rect.bottom - rect.top,
flags);
}
@@ -3415,7 +3415,7 @@ gdk_win32_window_iconify (GdkWindow *window)
if (GDK_WINDOW_IS_MAPPED (window))
{
old_active_window = GetActiveWindow ();
ShowWindow (GDK_WINDOW_HWND (window), SW_MINIMIZE);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_MINIMIZE);
if (old_active_window != GDK_WINDOW_HWND (window))
SetActiveWindow (old_active_window);
}
@@ -3486,7 +3486,7 @@ gdk_win32_window_maximize (GdkWindow *window)
_gdk_win32_window_state_to_string (window->state)));
if (GDK_WINDOW_IS_MAPPED (window))
ShowWindow (GDK_WINDOW_HWND (window), SW_MAXIMIZE);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_MAXIMIZE);
else
gdk_synthesize_window_state (window,
0,
@@ -3506,7 +3506,7 @@ gdk_win32_window_unmaximize (GdkWindow *window)
_gdk_win32_window_state_to_string (window->state)));
if (GDK_WINDOW_IS_MAPPED (window))
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
else
gdk_synthesize_window_state (window,
GDK_WINDOW_STATE_MAXIMIZED,
@@ -3658,13 +3658,13 @@ gdk_win32_window_focus (GdkWindow *window,
_gdk_win32_window_state_to_string (window->state)));
if (window->state & GDK_WINDOW_STATE_MAXIMIZED)
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMAXIMIZED);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOWMAXIMIZED);
else if (window->state & GDK_WINDOW_STATE_ICONIFIED)
ShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_RESTORE);
else if (!IsWindowVisible (GDK_WINDOW_HWND (window)))
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNORMAL);
else
ShowWindow (GDK_WINDOW_HWND (window), SW_SHOW);
GtkShowWindow (GDK_WINDOW_HWND (window), SW_SHOW);
SetFocus (GDK_WINDOW_HWND (window));
}
@@ -3968,6 +3968,33 @@ gdk_win32_window_is_win32 (GdkWindow *window)
return GDK_WINDOW_IS_WIN32 (window);
}
static gboolean
gdk_win32_window_show_window_menu (GdkWindow *window,
GdkEvent *event)
{
double event_x, event_y;
gint x, y;
switch (event->type)
{
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
case GDK_TOUCH_BEGIN:
case GDK_TOUCH_END:
break;
default:
return FALSE;
}
gdk_event_get_root_coords (event, &event_x, &event_y);
x = event_x - _gdk_offset_x;
y = event_y - _gdk_offset_y;
SendMessage (GDK_WINDOW_HWND (window), WM_SYSMENU, 0, MAKELPARAM (x, y));
return TRUE;
}
/**
* _gdk_win32_acquire_dc
* @impl: a Win32 #GdkWindowImplWin32 implementation
@@ -4157,6 +4184,81 @@ gdk_win32_ref_cairo_surface (GdkWindow *window)
return impl->cairo_surface;
}
BOOL WINAPI
GtkShowWindow (HWND hwnd,
int cmd_show)
{
cairo_t *cr;
cairo_surface_t *surface;
RECT window_rect;
HDC hdc;
POINT window_position;
SIZE window_size;
POINT source_point;
BLENDFUNCTION blender;
switch (cmd_show)
{
case SW_FORCEMINIMIZE:
case SW_HIDE:
case SW_MINIMIZE:
break;
case SW_MAXIMIZE:
case SW_RESTORE:
case SW_SHOW:
case SW_SHOWDEFAULT:
case SW_SHOWMINIMIZED:
case SW_SHOWMINNOACTIVE:
case SW_SHOWNA:
case SW_SHOWNOACTIVATE:
case SW_SHOWNORMAL:
if (IsWindowVisible (hwnd))
break;
if ((WS_EX_LAYERED & GetWindowLongPtr (hwnd, GWL_EXSTYLE)) != WS_EX_LAYERED)
break;
/* Window was hidden, will be shown. Erase it, GDK will repaint soon,
* but not soon enough, so it's possible to see old content before
* the next redraw, unless we erase the window first.
*/
GetWindowRect (hwnd, &window_rect);
source_point.x = source_point.y = 0;
window_position.x = window_rect.left;
window_position.y = window_rect.top;
window_size.cx = window_rect.right - window_rect.left;
window_size.cy = window_rect.bottom - window_rect.top;
blender.BlendOp = AC_SRC_OVER;
blender.BlendFlags = 0;
blender.AlphaFormat = AC_SRC_ALPHA;
blender.SourceConstantAlpha = 255;
/* Create a surface of appropriate size and clear it */
surface = cairo_win32_surface_create_with_dib (CAIRO_FORMAT_ARGB32, window_size.cx, window_size.cy);
cr = cairo_create (surface);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.0);
cairo_paint (cr);
cairo_destroy (cr);
cairo_surface_flush (surface);
hdc = cairo_win32_surface_get_dc (surface);
/* No API_CALL() wrapper, don't check for errors */
UpdateLayeredWindow (hwnd, NULL,
&window_position, &window_size,
hdc, &source_point,
0, &blender, ULW_ALPHA);
cairo_surface_destroy (surface);
break;
}
return ShowWindow (hwnd, cmd_show);
}
static void
gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
{
@@ -4197,6 +4299,8 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
//impl_class->beep = gdk_x11_window_beep;
impl_class->show_window_menu = gdk_win32_window_show_window_menu;
impl_class->focus = gdk_win32_window_focus;
impl_class->set_type_hint = gdk_win32_window_set_type_hint;
impl_class->get_type_hint = gdk_win32_window_get_type_hint;
+11
View File
@@ -141,6 +141,11 @@ struct _GdkWindowImplWin32
*/
guint layered : 1;
/* If TRUE, the @temp_styles is set to the styles that were temporarily
* added to this window.
*/
guint have_temp_styles : 1;
/* GDK does not keep window contents around, it just draws new
* stuff over the window where changes occurred.
* cache_surface retains old window contents, because
@@ -173,6 +178,12 @@ struct _GdkWindowImplWin32
/* No. of windows to force layered windows off */
guint suppress_layered;
/* Temporary styles that this window got for the purpose of
* handling WM_SYSMENU.
* They are removed at the first opportunity (usually WM_INITMENU).
*/
LONG_PTR temp_styles;
};
struct _GdkWindowImplWin32Class
+7 -3
View File
@@ -2878,10 +2878,14 @@ gdk_x11_display_get_default_seat (GdkDisplay *display)
{
GList *seats, *l;
int device_id;
gboolean result = FALSE;
seats = gdk_display_list_seats (display);
XIGetClientPointer (GDK_DISPLAY_XDISPLAY (display),
None, &device_id);
gdk_x11_display_error_trap_push (display);
result = XIGetClientPointer (GDK_DISPLAY_XDISPLAY (display),
None, &device_id);
gdk_x11_display_error_trap_pop_ignored (display);
for (l = seats; l; l = l->next)
{
@@ -2889,7 +2893,7 @@ gdk_x11_display_get_default_seat (GdkDisplay *display)
pointer = gdk_seat_get_pointer (l->data);
if (gdk_x11_device_get_id (pointer) == device_id)
if (gdk_x11_device_get_id (pointer) == device_id || !result)
{
GdkSeat *seat = l->data;
g_list_free (seats);
+16 -2
View File
@@ -1705,6 +1705,7 @@ xdnd_enter_filter (GdkXEvent *xev,
context_x11 = (GdkX11DragContext *)g_object_new (GDK_TYPE_X11_DRAG_CONTEXT, NULL);
context = (GdkDragContext *)context_x11;
context->display = display;
context->protocol = GDK_DRAG_PROTO_XDND;
context_x11->version = version;
@@ -2020,6 +2021,7 @@ _gdk_x11_window_drag_begin (GdkWindow *window,
context = (GdkDragContext *) g_object_new (GDK_TYPE_X11_DRAG_CONTEXT, NULL);
context->display = gdk_window_get_display (window);
context->is_source = TRUE;
context->source_window = window;
g_object_ref (window);
@@ -2654,6 +2656,7 @@ drag_context_grab (GdkDragContext *context)
{
GdkX11DragContext *x11_context = GDK_X11_DRAG_CONTEXT (context);
GdkDevice *device = gdk_drag_context_get_device (context);
GdkSeatCapabilities capabilities;
GdkWindow *root;
GdkSeat *seat;
gint keycode, i;
@@ -2664,8 +2667,15 @@ drag_context_grab (GdkDragContext *context)
root = gdk_screen_get_root_window (gdk_window_get_screen (x11_context->ipc_window));
seat = gdk_device_get_seat (gdk_drag_context_get_device (context));
#ifdef XINPUT_2
if (GDK_IS_X11_DEVICE_XI2 (device))
capabilities = GDK_SEAT_CAPABILITY_ALL_POINTING;
else
#endif
capabilities = GDK_SEAT_CAPABILITY_ALL;
if (gdk_seat_grab (seat, x11_context->ipc_window,
GDK_SEAT_CAPABILITY_ALL, FALSE,
capabilities, FALSE,
x11_context->cursor, NULL, NULL, NULL) != GDK_GRAB_SUCCESS)
return FALSE;
@@ -3032,6 +3042,10 @@ gdk_dnd_handle_grab_broken_event (GdkDragContext *context,
event->grab_window == x11_context->ipc_window)
return FALSE;
if (gdk_event_get_device ((GdkEvent *) event) !=
gdk_drag_context_get_device (context))
return FALSE;
gdk_drag_context_cancel (context, GDK_DRAG_CANCEL_ERROR);
return TRUE;
}
@@ -3132,6 +3146,6 @@ gdk_x11_drag_context_action_changed (GdkDragContext *context,
{
GdkCursor *cursor;
cursor = gdk_drag_get_cursor (action);
cursor = gdk_drag_get_cursor (context, action);
gdk_drag_context_set_cursor (context, cursor);
}
-6
View File
@@ -51,8 +51,6 @@ static GSourceFuncs event_funcs = {
gdk_event_source_finalize
};
static GList *event_sources = NULL;
static gint
gdk_event_apply_filters (XEvent *xevent,
GdkEvent *event,
@@ -383,8 +381,6 @@ gdk_event_source_finalize (GSource *source)
g_list_free (event_source->translators);
event_source->translators = NULL;
event_sources = g_list_remove (event_sources, source);
}
GSource *
@@ -415,8 +411,6 @@ gdk_x11_event_source_new (GdkDisplay *display)
g_source_set_can_recurse (source, TRUE);
g_source_attach (source, NULL);
event_sources = g_list_prepend (event_sources, source);
return source;
}
+2 -1
View File
@@ -329,7 +329,8 @@ gail_finish_select (GtkWidget *widget)
g_signal_connect (submenu, "map",
G_CALLBACK (gail_map_submenu_cb),
NULL);
return;
return;
}
/*
* If we are waiting to report focus on a menubar or a menu item
+3 -3
View File
@@ -464,7 +464,7 @@ set_recent_manager (GtkRecentAction *action,
GtkRecentActionPrivate *priv = action->priv;
if (manager)
priv->manager = NULL;
priv->manager = manager;
else
priv->manager = gtk_recent_manager_get_default ();
}
@@ -475,8 +475,6 @@ gtk_recent_action_finalize (GObject *gobject)
GtkRecentAction *action = GTK_RECENT_ACTION (gobject);
GtkRecentActionPrivate *priv = action->priv;
priv->manager = NULL;
if (priv->data_destroy)
{
priv->data_destroy (priv->sort_data);
@@ -503,6 +501,8 @@ gtk_recent_action_dispose (GObject *gobject)
priv->current_filter = NULL;
}
priv->manager = NULL;
G_OBJECT_CLASS (gtk_recent_action_parent_class)->dispose (gobject);
}
+92 -57
View File
@@ -1267,16 +1267,16 @@ get_child_node (GtkUIManager *manager,
NODE_INFO (child)->name,
NODE_INFO (child)->type);
if (node_is_dead (child))
{
/* This node was removed but is still dirty so
* it is still in the tree. We want to treat this
* as if it didn't exist, which means we move it
* to the position it would have been created at.
*/
g_node_unlink (child);
goto insert_child;
}
if (node_is_dead (child))
{
/* This node was removed but is still dirty so
* it is still in the tree. We want to treat this
* as if it didn't exist, which means we move it
* to the position it would have been created at.
*/
g_node_unlink (child);
goto insert_child;
}
return child;
}
@@ -3199,44 +3199,6 @@ mark_node_dirty (GNode *node)
NODE_INFO (p)->dirty = TRUE;
}
static const gchar *
open_tag_format (NodeType type)
{
switch (type)
{
case NODE_TYPE_UNDECIDED: return "%*s<UNDECIDED";
case NODE_TYPE_ROOT: return "%*s<ui";
case NODE_TYPE_MENUBAR: return "%*s<menubar";
case NODE_TYPE_MENU: return "%*s<menu";
case NODE_TYPE_TOOLBAR: return "%*s<toolbar";
case NODE_TYPE_MENU_PLACEHOLDER:
case NODE_TYPE_TOOLBAR_PLACEHOLDER: return "%*s<placeholder";
case NODE_TYPE_POPUP: return "%*s<popup";
case NODE_TYPE_MENUITEM: return "%*s<menuitem";
case NODE_TYPE_TOOLITEM: return "%*s<toolitem";
case NODE_TYPE_SEPARATOR: return "%*s<separator";
case NODE_TYPE_ACCELERATOR: return "%*s<accelerator";
default: return NULL;
}
}
static const gchar *
close_tag_format (NodeType type)
{
switch (type)
{
case NODE_TYPE_UNDECIDED: return "%*s</UNDECIDED>\n";
case NODE_TYPE_ROOT: return "%*s</ui>\n";
case NODE_TYPE_MENUBAR: return "%*s</menubar>\n";
case NODE_TYPE_MENU: return "%*s</menu>\n";
case NODE_TYPE_TOOLBAR: return "%*s</toolbar>\n";
case NODE_TYPE_MENU_PLACEHOLDER:
case NODE_TYPE_TOOLBAR_PLACEHOLDER: return "%*s</placeholder>\n";
case NODE_TYPE_POPUP: return "%*s</popup>\n";
default: return NULL;
}
}
static void
print_node (GtkUIManager *manager,
GNode *node,
@@ -3245,15 +3207,48 @@ print_node (GtkUIManager *manager,
{
Node *mnode;
GNode *child;
const gchar *open_fmt;
const gchar *close_fmt;
mnode = node->data;
open_fmt = open_tag_format (mnode->type);
close_fmt = close_tag_format (mnode->type);
g_string_append_printf (buffer, open_fmt, indent_level, "");
switch (mnode->type)
{
case NODE_TYPE_UNDECIDED:
g_string_append_printf (buffer, "%*s<UNDECIDED", indent_level, "");
break;
case NODE_TYPE_ROOT:
g_string_append_printf (buffer, "%*s<ui", indent_level, "");
break;
case NODE_TYPE_MENUBAR:
g_string_append_printf (buffer, "%*s<menubar", indent_level, "");
break;
case NODE_TYPE_MENU:
g_string_append_printf (buffer, "%*s<menu", indent_level, "");
break;
case NODE_TYPE_TOOLBAR:
g_string_append_printf (buffer, "%*s<toolbar", indent_level, "");
break;
case NODE_TYPE_MENU_PLACEHOLDER:
case NODE_TYPE_TOOLBAR_PLACEHOLDER:
g_string_append_printf (buffer, "%*s<placeholder", indent_level, "");
break;
case NODE_TYPE_POPUP:
g_string_append_printf (buffer, "%*s<popup", indent_level, "");
break;
case NODE_TYPE_MENUITEM:
g_string_append_printf (buffer, "%*s<menuitem", indent_level, "");
break;
case NODE_TYPE_TOOLITEM:
g_string_append_printf (buffer, "%*s<toolitem", indent_level, "");
break;
case NODE_TYPE_SEPARATOR:
g_string_append_printf (buffer, "%*s<separator", indent_level, "");
break;
case NODE_TYPE_ACCELERATOR:
g_string_append_printf (buffer, "%*s<accelerator", indent_level, "");
break;
default:
;; /* Nothing */
}
if (mnode->type != NODE_TYPE_ROOT)
{
@@ -3265,13 +3260,53 @@ print_node (GtkUIManager *manager,
g_quark_to_string (mnode->action_name));
}
g_string_append (buffer, close_fmt ? ">\n" : "/>\n");
switch (mnode->type)
{
case NODE_TYPE_UNDECIDED:
case NODE_TYPE_ROOT:
case NODE_TYPE_MENUBAR:
case NODE_TYPE_MENU:
case NODE_TYPE_TOOLBAR:
case NODE_TYPE_MENU_PLACEHOLDER:
case NODE_TYPE_TOOLBAR_PLACEHOLDER:
case NODE_TYPE_POPUP:
g_string_append (buffer, ">\n");
break;
default:
g_string_append (buffer, "/>\n");
break;
}
for (child = node->children; child != NULL; child = child->next)
print_node (manager, child, indent_level + 2, buffer);
if (close_fmt)
g_string_append_printf (buffer, close_fmt, indent_level, "");
switch (mnode->type)
{
case NODE_TYPE_UNDECIDED:
g_string_append_printf (buffer, "%*s</UNDECIDED>\n", indent_level, "");
break;
case NODE_TYPE_ROOT:
g_string_append_printf (buffer, "%*s</ui>\n", indent_level, "");
break;
case NODE_TYPE_MENUBAR:
g_string_append_printf (buffer, "%*s</menubar>\n", indent_level, "");
break;
case NODE_TYPE_MENU:
g_string_append_printf (buffer, "%*s</menu>\n", indent_level, "");
break;
case NODE_TYPE_TOOLBAR:
g_string_append_printf (buffer, "%*s</toolbar>\n", indent_level, "");
break;
case NODE_TYPE_MENU_PLACEHOLDER:
case NODE_TYPE_TOOLBAR_PLACEHOLDER:
g_string_append_printf (buffer, "%*s</placeholder>\n", indent_level, "");
break;
case NODE_TYPE_POPUP:
g_string_append_printf (buffer, "%*s</popup>\n", indent_level, "");
break;
default:
;; /* Nothing */
}
}
static gboolean
+1
View File
@@ -164,6 +164,7 @@ needs_explicit_setting (MyParserData *data,
{ "GtkCalendar", "year", 0 },
{ "GtkCalendar", "month", 0 },
{ "GtkCalendar", "day", 0 },
{ "GtkDialog", "border-width", 0 },
{ "GtkPlacesSidebar", "show-desktop", 0 },
{ "GtkRadioButton", "draw-indicator", 0 },
{ "GtkGrid", "left-attach", 1 },
+4 -6
View File
@@ -108,11 +108,6 @@ typedef struct
const gchar *url;
} LicenseInfo;
/* Translators: this is the license preamble; the string at the end
* contains the name of the license as link text.
*/
static const gchar *gtk_license_preamble = N_("This program comes with absolutely no warranty.\nSee the <a href=\"%s\">%s</a> for details.");
/* LicenseInfo for each GtkLicense type; keep in the same order as the enumeration */
static const LicenseInfo gtk_license_info [] = {
{ N_("License"), NULL },
@@ -2488,7 +2483,10 @@ gtk_about_dialog_set_license_type (GtkAboutDialog *about,
url = priv->website_url;
str = g_string_sized_new (256);
g_string_append_printf (str, _(gtk_license_preamble), url, name);
/* Translators: this is the license preamble; the string at the end
* contains the name of the license as link text.
*/
g_string_append_printf (str, _("This program comes with absolutely no warranty.\nSee the <a href=\"%s\">%s</a> for details."), url, name);
g_free (priv->license);
priv->license = g_string_free (str, FALSE);
+1 -1
View File
@@ -40,7 +40,7 @@
* The action will be looked up in action groups that are found among
* the widgets ancestors. Most commonly, these will be the actions with
* the win. or app. prefix that are associated with the #GtkApplicationWindow
* or "GtkApplication, but other action groups that are added with
* or #GtkApplication, but other action groups that are added with
* gtk_widget_insert_action_group() will be consulted as well.
*
* Since: 3.4
+6 -6
View File
@@ -147,12 +147,12 @@ gtk_action_helper_action_added (GtkActionHelper *helper,
if (!helper->can_activate)
{
GTK_NOTE(ACTIONS, g_message ("%s: action %s can't be activated due to parameter type mismatch "
"(parameter type %s, target type %s)",
"actionhelper",
helper->action_name,
parameter_type ? g_variant_type_peek_string (parameter_type) : "NULL",
helper->target ? g_variant_get_type_string (helper->target) : "NULL"));
g_warning ("%s: action %s can't be activated due to parameter type mismatch "
"(parameter type %s, target type %s)",
"actionhelper",
helper->action_name,
parameter_type ? g_variant_type_peek_string (parameter_type) : "NULL",
helper->target ? g_variant_get_type_string (helper->target) : "NULL");
return;
}
+45 -51
View File
@@ -103,8 +103,8 @@
* defines a #GtkShortcutsWindow with ID "help_overlay" then GtkApplication
* associates an instance of this shortcuts window with each
* #GtkApplicationWindow and sets up keyboard accelerators (Control-F1
* and Control-?) to open it. To create an menu item that displays the
* shortcuts window associate the item with the action win.show-help-overlay.
* and Control-?) to open it. To create a menu item that displays the
* shortcuts window, associate the item with the action win.show-help-overlay.
*
* ## A simple application ## {#gtkapplication}
*
@@ -525,7 +525,7 @@ gtk_application_focus_in_event_cb (GtkWindow *window,
g_object_notify_by_pspec (G_OBJECT (application), gtk_application_props[PROP_ACTIVE_WINDOW]);
return FALSE;
return GDK_EVENT_PROPAGATE;
}
static void
@@ -607,14 +607,16 @@ gtk_application_load_resources (GtkApplication *application)
path = g_strconcat (base_path, "/gtk/help-overlay.ui", NULL);
if (g_resources_get_info (path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL))
{
const gchar * const accels[] = { "<Primary>F1", "<Primary>question", NULL };
{
const gchar * const accels[] = { "<Primary>F1", "<Primary>question", NULL };
application->priv->help_overlay_path = path;
gtk_application_set_accels_for_action (application, "win.show-help-overlay", accels);
}
else
g_free (path);
application->priv->help_overlay_path = path;
gtk_application_set_accels_for_action (application, "win.show-help-overlay", accels);
}
else
{
g_free (path);
}
}
}
@@ -628,7 +630,7 @@ gtk_application_startup (GApplication *g_application)
gtk_action_muxer_insert (application->priv->muxer, "app", G_ACTION_GROUP (application));
gtk_init (0, 0);
gtk_init (NULL, NULL);
application->priv->impl = gtk_application_impl_new (application, gdk_display_get_default ());
gtk_application_impl_startup (application->priv->impl, application->priv->register_session);
@@ -808,10 +810,15 @@ extract_accel_from_menu_item (GMenuModel *model,
}
g_object_unref (iter);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (accel && action)
gtk_application_add_accelerator (app, accel, action, target);
G_GNUC_END_IGNORE_DEPRECATIONS
{
const gchar *accels[2] = { accel, NULL };
gchar *detailed_action_name;
detailed_action_name = g_action_print_detailed_name (action, target);
gtk_application_set_accels_for_action (app, detailed_action_name, accels);
g_free (detailed_action_name);
}
if (target)
g_variant_unref (target);
@@ -822,19 +829,19 @@ extract_accels_from_menu (GMenuModel *model,
GtkApplication *app)
{
gint i;
GMenuLinkIter *iter;
const gchar *key;
GMenuModel *m;
for (i = 0; i < g_menu_model_get_n_items (model); i++)
{
GMenuLinkIter *iter;
GMenuModel *sub_model;
extract_accel_from_menu_item (model, i, app);
iter = g_menu_model_iterate_item_links (model, i);
while (g_menu_link_iter_get_next (iter, &key, &m))
while (g_menu_link_iter_get_next (iter, NULL, &sub_model))
{
extract_accels_from_menu (m, app);
g_object_unref (m);
extract_accels_from_menu (sub_model, app);
g_object_unref (sub_model);
}
g_object_unref (iter);
}
@@ -1157,6 +1164,9 @@ gtk_application_get_windows (GtkApplication *application)
*
* Returns the #GtkApplicationWindow with the given ID.
*
* The ID of a #GtkApplicationWindow can be retrieved with
* gtk_application_window_get_id().
*
* Returns: (nullable) (transfer none): the window with ID @id, or
* %NULL if there is no window with this ID
*
@@ -1248,17 +1258,15 @@ gtk_application_add_accelerator (GtkApplication *application,
GVariant *parameter)
{
const gchar *accelerators[2] = { accelerator, NULL };
gchar *action_and_target;
gchar *detailed_action_name;
g_return_if_fail (GTK_IS_APPLICATION (application));
g_return_if_fail (action_name != NULL);
g_return_if_fail (accelerator != NULL);
action_and_target = gtk_print_action_and_target (NULL, action_name, parameter);
accels_set_accels_for_action (&application->priv->accels, action_and_target, accelerators);
gtk_action_muxer_set_primary_accel (application->priv->muxer, action_and_target, accelerator);
gtk_application_update_accels (application);
g_free (action_and_target);
detailed_action_name = g_action_print_detailed_name (action_name, parameter);
gtk_application_set_accels_for_action (application, detailed_action_name, accelerators);
g_free (detailed_action_name);
}
/**
@@ -1280,16 +1288,15 @@ gtk_application_remove_accelerator (GtkApplication *application,
const gchar *action_name,
GVariant *parameter)
{
gchar *action_and_target;
const gchar *accelerators[1] = { NULL };
gchar *detailed_action_name;
g_return_if_fail (GTK_IS_APPLICATION (application));
g_return_if_fail (action_name != NULL);
action_and_target = gtk_print_action_and_target (NULL, action_name, parameter);
accels_set_accels_for_action (&application->priv->accels, action_and_target, NULL);
gtk_action_muxer_set_primary_accel (application->priv->muxer, action_and_target, NULL);
gtk_application_update_accels (application);
g_free (action_and_target);
detailed_action_name = g_action_print_detailed_name (action_name, parameter);
gtk_application_set_accels_for_action (application, detailed_action_name, accelerators);
g_free (detailed_action_name);
}
/**
@@ -1376,16 +1383,8 @@ gtk_application_set_app_menu (GtkApplication *application,
g_return_if_fail (g_application_get_is_registered (G_APPLICATION (application)));
g_return_if_fail (!g_application_get_is_remote (G_APPLICATION (application)));
if (app_menu != application->priv->app_menu)
if (g_set_object (&application->priv->app_menu, app_menu))
{
if (application->priv->app_menu != NULL)
g_object_unref (application->priv->app_menu);
application->priv->app_menu = app_menu;
if (application->priv->app_menu != NULL)
g_object_ref (application->priv->app_menu);
if (app_menu)
extract_accels_from_menu (app_menu, application);
@@ -1448,16 +1447,8 @@ gtk_application_set_menubar (GtkApplication *application,
g_return_if_fail (g_application_get_is_registered (G_APPLICATION (application)));
g_return_if_fail (!g_application_get_is_remote (G_APPLICATION (application)));
if (menubar != application->priv->menubar)
if (g_set_object (&application->priv->menubar, menubar))
{
if (application->priv->menubar != NULL)
g_object_unref (application->priv->menubar);
application->priv->menubar = menubar;
if (application->priv->menubar != NULL)
g_object_ref (application->priv->menubar);
if (menubar)
extract_accels_from_menu (menubar, application);
@@ -1518,7 +1509,7 @@ gtk_application_get_menubar (GtkApplication *application)
* types of actions that may be blocked are specified by the @flags
* parameter. When the application completes the operation it should
* call gtk_application_uninhibit() to remove the inhibitor. Note that
* an application can have multiple inhibitors, and all of the must
* an application can have multiple inhibitors, and all of them must
* be individually removed. Inhibitors are also cleared when the
* application exits.
*
@@ -1702,6 +1693,9 @@ normalise_detailed_name (const gchar *detailed_action_name)
* To remove all accelerators for an action, use an empty, zero-terminated
* array for @accels.
*
* For the @detailed_action_name, see g_action_parse_detailed_name() and
* g_action_print_detailed_name().
*
* Since: 3.12
*/
void
+3 -3
View File
@@ -38,7 +38,7 @@
* @title: GtkApplicationWindow
* @short_description: GtkWindow subclass with GtkApplication support
*
* GtkApplicationWindow is a #GtkWindow subclass that offers some
* #GtkApplicationWindow is a #GtkWindow subclass that offers some
* extra functionality for better integration with #GtkApplication
* features. Notably, it can handle both the application menu as well
* as the menubar. See gtk_application_set_app_menu() and
@@ -52,9 +52,9 @@
* prefix. Actions must be addressed with the prefixed name when
* referring to them from a #GMenuModel.
*
* Note that widgets that are placed inside a GtkApplicationWindow
* Note that widgets that are placed inside a #GtkApplicationWindow
* can also activate these actions, if they implement the
* GtkActionable interface.
* #GtkActionable interface.
*
* As with #GtkApplication, the GDK lock will be acquired when
* processing actions arriving from other processes and should therefore
+29 -6
View File
@@ -47,6 +47,12 @@
* with high key binding configurability which requires no application
* or toolkit side changes.
*
* In order for bindings to work in a custom widget implementation, the
* widgets #GtkWidget:can-focus and #GtkWidget:has-focus properties
* must both be true. For example, by calling gtk_widget_set_can_focus()
* in the widgets initialisation function; and by calling
* gtk_widget_grab_focus() when the widget is clicked.
*
* # Installing a key binding
*
* A CSS file binding consists of a binding-set definition and a match
@@ -69,13 +75,14 @@
* movement occurs in 3-character steps), the following binding can be
* used:
*
* |[
* |[ <!-- language="CSS" -->
* @binding-set MoveCursor3
* {
* bind "<Control>Right" { "move-cursor" (visual-positions, 3, 0) };
* bind "<Control>Left" { "move-cursor" (visual-positions, -3, 0) };
* }
* GtkEntry
*
* entry
* {
* -gtk-key-bindings: MoveCursor3;
* }
@@ -91,13 +98,14 @@
* works as expected. The same mechanism can not be used to unbind
* existing bindings, however.
*
* |[
* |[ <!-- language="CSS" -->
* @binding-set MoveCursor3
* {
* bind "<Control>Right" { };
* bind "<Control>Left" { };
* }
* GtkEntry
*
* entry
* {
* -gtk-key-bindings: MoveCursor3;
* }
@@ -114,13 +122,14 @@
* from activating its default bindings, the unbind keyword can be used
* like this:
*
* |[
* |[ <!-- language="CSS" -->
* @binding-set MoveCursor3
* {
* unbind "<Control>Right";
* unbind "<Control>Left";
* }
* GtkEntry
*
* entry
* {
* -gtk-key-bindings: MoveCursor3;
* }
@@ -984,6 +993,20 @@ _gtk_binding_entry_add_signall (GtkBindingSet *binding_set,
* @binding_set. When the binding is activated, @signal_name will be
* emitted on the target widget, with @n_args @Varargs used as
* arguments.
*
* Each argument to the signal must be passed as a pair of varargs: the
* #GType of the argument, followed by the argument value (which must
* be of the given type). There must be @n_args pairs in total.
*
* ## Adding a Key Binding
*
* |[<!-- language="C" -->
* gtk_binding_entry_add_signal (binding_set, keyval, modmask,
* "move-cursor", 3,
* G_TYPE_ENUM, step,
* G_TYPE_INT, count,
* G_TYPE_BOOLEAN, FALSE);
* ]|
*/
void
gtk_binding_entry_add_signal (GtkBindingSet *binding_set,
+71 -69
View File
@@ -38,9 +38,10 @@ struct _GtkBoxGadgetPrivate {
GtkOrientation orientation;
GArray *children;
guint draw_focus : 1;
guint draw_reverse : 1;
guint draw_focus : 1;
guint draw_reverse : 1;
guint allocate_reverse : 1;
guint align_reverse : 1;
};
typedef gboolean (* ComputeExpandFunc) (GObject *object, GtkOrientation orientation);
@@ -48,7 +49,7 @@ typedef gboolean (* ComputeExpandFunc) (GObject *object, GtkOrientation orientat
typedef struct _GtkBoxGadgetChild GtkBoxGadgetChild;
struct _GtkBoxGadgetChild {
GObject *object;
ComputeExpandFunc compute_expand;
gboolean expand;
GtkAlign align;
};
@@ -64,6 +65,21 @@ gtk_box_gadget_child_is_visible (GObject *child)
return gtk_css_gadget_get_visible (GTK_CSS_GADGET (child));
}
static gboolean
gtk_box_gadget_child_compute_expand (GtkBoxGadget *gadget,
GtkBoxGadgetChild *child)
{
GtkBoxGadgetPrivate *priv = gtk_box_gadget_get_instance_private (GTK_BOX_GADGET (gadget));
if (child->expand)
return TRUE;
if (GTK_IS_WIDGET (child->object))
return gtk_widget_compute_expand (GTK_WIDGET (child->object), priv->orientation);
return FALSE;
}
static GtkAlign
gtk_box_gadget_child_get_align (GtkBoxGadget *gadget,
GtkBoxGadgetChild *child)
@@ -84,6 +100,21 @@ gtk_box_gadget_child_get_align (GtkBoxGadget *gadget,
return align;
}
static GtkAlign
effective_align (GtkAlign align,
gboolean reverse)
{
switch (align)
{
case GTK_ALIGN_START:
return reverse ? GTK_ALIGN_END : GTK_ALIGN_START;
case GTK_ALIGN_END:
return reverse ? GTK_ALIGN_START : GTK_ALIGN_END;
default:
return align;
}
}
static void
gtk_box_gadget_measure_child (GObject *child,
GtkOrientation orientation,
@@ -132,7 +163,7 @@ gtk_box_gadget_distribute (GtkBoxGadget *gadget,
&sizes[i].minimum_size, &sizes[i].natural_size,
NULL, NULL);
if (gtk_box_gadget_child_is_visible (child->object) &&
child->compute_expand (child->object, priv->orientation))
gtk_box_gadget_child_compute_expand (gadget, child))
n_expand++;
size -= sizes[i].minimum_size;
}
@@ -153,7 +184,7 @@ gtk_box_gadget_distribute (GtkBoxGadget *gadget,
GtkBoxGadgetChild *child = &g_array_index (priv->children, GtkBoxGadgetChild, i);
if (!gtk_box_gadget_child_is_visible (child->object) ||
!child->compute_expand (child->object, priv->orientation))
!gtk_box_gadget_child_compute_expand (gadget, child))
continue;
sizes[i].minimum_size += size / n_expand;
@@ -304,6 +335,7 @@ gtk_box_gadget_allocate_child (GObject *child,
allocation->width,
&minimum, &natural,
&minimum_baseline, &natural_baseline);
switch (child_align)
{
case GTK_ALIGN_FILL:
@@ -407,7 +439,7 @@ gtk_box_gadget_allocate (GtkCssGadget *gadget,
child_align = gtk_box_gadget_child_get_align (GTK_BOX_GADGET (gadget), child);
gtk_box_gadget_allocate_child (child->object,
priv->orientation,
child_align,
effective_align (child_align, priv->align_reverse),
&child_allocation,
baseline,
&child_clip);
@@ -441,7 +473,7 @@ gtk_box_gadget_allocate (GtkCssGadget *gadget,
child_align = gtk_box_gadget_child_get_align (GTK_BOX_GADGET (gadget), child);
gtk_box_gadget_allocate_child (child->object,
priv->orientation,
child_align,
effective_align (child_align, priv->align_reverse),
&child_allocation,
-1,
&child_clip);
@@ -595,6 +627,15 @@ gtk_box_gadget_set_allocate_reverse (GtkBoxGadget *gadget,
priv->allocate_reverse = allocate_reverse;
}
void
gtk_box_gadget_set_align_reverse (GtkBoxGadget *gadget,
gboolean align_reverse)
{
GtkBoxGadgetPrivate *priv = gtk_box_gadget_get_instance_private (gadget);
priv->align_reverse = align_reverse;
}
static GtkCssNode *
get_css_node (GObject *child)
{
@@ -605,17 +646,17 @@ get_css_node (GObject *child)
}
static void
gtk_box_gadget_insert_object (GtkBoxGadget *gadget,
int pos,
GObject *object,
ComputeExpandFunc compute_expand_func,
GtkAlign align)
gtk_box_gadget_insert_object (GtkBoxGadget *gadget,
int pos,
GObject *object,
gboolean expand,
GtkAlign align)
{
GtkBoxGadgetPrivate *priv = gtk_box_gadget_get_instance_private (gadget);
GtkBoxGadgetChild child;
child.object = g_object_ref (object);
child.compute_expand = compute_expand_func;
child.expand = expand;
child.align = align;
if (pos < 0 || pos >= priv->children->len)
@@ -635,15 +676,11 @@ gtk_box_gadget_insert_object (GtkBoxGadget *gadget,
}
void
gtk_box_gadget_insert_widget (GtkBoxGadget *gadget,
int pos,
GtkWidget *widget)
gtk_box_gadget_insert_widget (GtkBoxGadget *gadget,
int pos,
GtkWidget *widget)
{
gtk_box_gadget_insert_object (gadget,
pos,
G_OBJECT (widget),
(ComputeExpandFunc) gtk_widget_compute_expand,
GTK_ALIGN_FILL);
gtk_box_gadget_insert_object (gadget, pos, G_OBJECT (widget), FALSE, GTK_ALIGN_FILL);
}
static GtkBoxGadgetChild *
@@ -692,34 +729,11 @@ gtk_box_gadget_remove_widget (GtkBoxGadget *gadget,
gtk_box_gadget_remove_object (gadget, G_OBJECT (widget));
}
static gboolean
only_horizontal (GObject *object,
GtkOrientation orientation)
{
return orientation == GTK_ORIENTATION_HORIZONTAL;
}
static gboolean
only_vertical (GObject *object,
GtkOrientation orientation)
{
return orientation == GTK_ORIENTATION_VERTICAL;
}
static ComputeExpandFunc
expand_func_from_flags (gboolean hexpand,
gboolean vexpand)
{
return hexpand ? (vexpand ? (ComputeExpandFunc) gtk_true : only_horizontal)
: (vexpand ? only_vertical : (ComputeExpandFunc) gtk_false);
}
void
gtk_box_gadget_insert_gadget_before (GtkBoxGadget *gadget,
GtkCssGadget *sibling,
GtkCssGadget *cssgadget,
gboolean hexpand,
gboolean vexpand,
gboolean expand,
GtkAlign align)
{
/* Insert at the end if no sibling specified */
@@ -728,15 +742,14 @@ gtk_box_gadget_insert_gadget_before (GtkBoxGadget *gadget,
if (sibling)
gtk_box_gadget_find_object (gadget, G_OBJECT (sibling), &pos);
gtk_box_gadget_insert_gadget (gadget, pos, cssgadget, hexpand, vexpand, align);
gtk_box_gadget_insert_gadget (gadget, pos, cssgadget, expand, align);
}
void
gtk_box_gadget_insert_gadget_after (GtkBoxGadget *gadget,
GtkCssGadget *sibling,
GtkCssGadget *cssgadget,
gboolean hexpand,
gboolean vexpand,
gboolean expand,
GtkAlign align)
{
/* Insert at the beginning if no sibling specified */
@@ -745,25 +758,17 @@ gtk_box_gadget_insert_gadget_after (GtkBoxGadget *gadget,
if (sibling && gtk_box_gadget_find_object (gadget, G_OBJECT (sibling), &pos))
pos++;
gtk_box_gadget_insert_gadget (gadget, pos, cssgadget, hexpand, vexpand, align);
gtk_box_gadget_insert_gadget (gadget, pos, cssgadget, expand, align);
}
void
gtk_box_gadget_insert_gadget (GtkBoxGadget *gadget,
int pos,
GtkCssGadget *cssgadget,
gboolean hexpand,
gboolean vexpand,
gboolean expand,
GtkAlign align)
{
ComputeExpandFunc func;
func = expand_func_from_flags (hexpand, vexpand);
gtk_box_gadget_insert_object (gadget,
pos,
G_OBJECT (cssgadget),
func,
align);
gtk_box_gadget_insert_object (gadget, pos, G_OBJECT (cssgadget), expand, align);
}
void
@@ -795,34 +800,31 @@ gtk_box_gadget_reverse_children (GtkBoxGadget *gadget)
void
gtk_box_gadget_set_gadget_expand (GtkBoxGadget *gadget,
GtkCssGadget *cssgadget,
gboolean hexpand,
gboolean vexpand)
GObject *object,
gboolean expand)
{
GtkBoxGadgetChild *child;
ComputeExpandFunc func;
child = gtk_box_gadget_find_object (gadget, G_OBJECT (cssgadget), NULL);
child = gtk_box_gadget_find_object (gadget, object, NULL);
if (!child)
return;
func = expand_func_from_flags (hexpand, vexpand);
if (child->compute_expand == func)
if (child->expand == expand)
return;
child->compute_expand = func;
child->expand = expand;
gtk_css_gadget_queue_resize (GTK_CSS_GADGET (gadget));
}
void
gtk_box_gadget_set_gadget_align (GtkBoxGadget *gadget,
GtkCssGadget *cssgadget,
GObject *object,
GtkAlign align)
{
GtkBoxGadgetChild *child;
child = gtk_box_gadget_find_object (gadget, G_OBJECT (cssgadget), NULL);
child = gtk_box_gadget_find_object (gadget, object, NULL);
if (!child)
return;
+8 -10
View File
@@ -63,6 +63,8 @@ void gtk_box_gadget_set_draw_reverse (GtkBoxGadget
void gtk_box_gadget_set_allocate_reverse (GtkBoxGadget *gadget,
gboolean allocate_reverse);
void gtk_box_gadget_set_align_reverse (GtkBoxGadget *gadget,
gboolean align_reverse);
void gtk_box_gadget_insert_widget (GtkBoxGadget *gadget,
int pos,
GtkWidget *widget);
@@ -71,20 +73,17 @@ void gtk_box_gadget_remove_widget (GtkBoxGadget
void gtk_box_gadget_insert_gadget (GtkBoxGadget *gadget,
int pos,
GtkCssGadget *cssgadget,
gboolean hexpand,
gboolean vexpand,
gboolean expand,
GtkAlign align);
void gtk_box_gadget_insert_gadget_before (GtkBoxGadget *gadget,
GtkCssGadget *sibling,
GtkCssGadget *cssgadget,
gboolean hexpand,
gboolean vexpand,
gboolean expand,
GtkAlign align);
void gtk_box_gadget_insert_gadget_after (GtkBoxGadget *gadget,
GtkCssGadget *sibling,
GtkCssGadget *cssgadget,
gboolean hexpand,
gboolean vexpand,
gboolean expand,
GtkAlign align);
void gtk_box_gadget_remove_gadget (GtkBoxGadget *gadget,
@@ -92,11 +91,10 @@ void gtk_box_gadget_remove_gadget (GtkBoxGadget
void gtk_box_gadget_reverse_children (GtkBoxGadget *gadget);
void gtk_box_gadget_set_gadget_expand (GtkBoxGadget *gadget,
GtkCssGadget *cssgadget,
gboolean hexpand,
gboolean vexpand);
GObject *object,
gboolean expand);
void gtk_box_gadget_set_gadget_align (GtkBoxGadget *gadget,
GtkCssGadget *cssgadget,
GObject *object,
GtkAlign align);
G_END_DECLS
+39 -16
View File
@@ -47,6 +47,8 @@ typedef struct _GtkBuiltinIconPrivate GtkBuiltinIconPrivate;
struct _GtkBuiltinIconPrivate {
GtkCssImageBuiltinType image_type;
int default_size;
int strikethrough;
gboolean strikethrough_valid;
char * default_size_property;
};
@@ -63,10 +65,6 @@ gtk_builtin_icon_get_preferred_size (GtkCssGadget *gadget,
gint *natural_baseline)
{
GtkBuiltinIconPrivate *priv = gtk_builtin_icon_get_instance_private (GTK_BUILTIN_ICON (gadget));
GtkWidget *widget;
PangoContext *pango_context;
PangoFontMetrics *metrics;
int strikethrough;
double min_size;
guint property;
@@ -98,21 +96,33 @@ gtk_builtin_icon_get_preferred_size (GtkCssGadget *gadget,
*minimum = *natural = priv->default_size;
}
widget = gtk_css_gadget_get_owner (gadget);
pango_context = gtk_widget_get_pango_context (widget);
metrics = pango_context_get_metrics (pango_context,
pango_context_get_font_description (pango_context),
pango_context_get_language (pango_context));
strikethrough = pango_font_metrics_get_strikethrough_position (metrics);
if (minimum_baseline)
*minimum_baseline = *minimum * 0.5 + PANGO_PIXELS (strikethrough);
{
if (!priv->strikethrough_valid)
{
GtkWidget *widget;
PangoContext *pango_context;
const PangoFontDescription *font_desc;
PangoFontMetrics *metrics;
widget = gtk_css_gadget_get_owner (gadget);
pango_context = gtk_widget_get_pango_context (widget);
font_desc = pango_context_get_font_description (pango_context);
metrics = pango_context_get_metrics (pango_context,
font_desc,
pango_context_get_language (pango_context));
priv->strikethrough = pango_font_metrics_get_strikethrough_position (metrics);
priv->strikethrough_valid = TRUE;
pango_font_metrics_unref (metrics);
}
*minimum_baseline = *minimum * 0.5 + PANGO_PIXELS (priv->strikethrough);
}
if (natural_baseline)
*natural_baseline = *minimum_baseline;
pango_font_metrics_unref (metrics);
}
static void
@@ -151,6 +161,18 @@ gtk_builtin_icon_draw (GtkCssGadget *gadget,
return FALSE;
}
static void
gtk_builtin_icon_style_changed (GtkCssGadget *gadget,
GtkCssStyleChange *change)
{
GtkBuiltinIconPrivate *priv = gtk_builtin_icon_get_instance_private (GTK_BUILTIN_ICON (gadget));
if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_FONT))
priv->strikethrough_valid = FALSE;
GTK_CSS_GADGET_CLASS (gtk_builtin_icon_parent_class)->style_changed (gadget, change);
}
static void
gtk_builtin_icon_finalize (GObject *object)
{
@@ -172,6 +194,7 @@ gtk_builtin_icon_class_init (GtkBuiltinIconClass *klass)
gadget_class->get_preferred_size = gtk_builtin_icon_get_preferred_size;
gadget_class->allocate = gtk_builtin_icon_allocate;
gadget_class->draw = gtk_builtin_icon_draw;
gadget_class->style_changed = gtk_builtin_icon_style_changed;
}
static void
+5 -5
View File
@@ -115,7 +115,7 @@ enum {
};
static void gtk_button_destroy (GtkWidget *widget);
static void gtk_button_finalize (GObject *object);
static void gtk_button_dispose (GObject *object);
static void gtk_button_set_property (GObject *object,
guint prop_id,
@@ -241,6 +241,7 @@ gtk_button_class_init (GtkButtonClass *klass)
gobject_class->constructed = gtk_button_constructed;
gobject_class->dispose = gtk_button_dispose;
gobject_class->finalize = gtk_button_finalize;
gobject_class->set_property = gtk_button_set_property;
gobject_class->get_property = gtk_button_get_property;
@@ -249,7 +250,6 @@ gtk_button_class_init (GtkButtonClass *klass)
widget_class->get_preferred_width_for_height = gtk_button_get_preferred_width_for_height;
widget_class->get_preferred_height_for_width = gtk_button_get_preferred_height_for_width;
widget_class->get_preferred_height_and_baseline_for_width = gtk_button_get_preferred_height_and_baseline_for_width;
widget_class->destroy = gtk_button_destroy;
widget_class->screen_changed = gtk_button_screen_changed;
widget_class->realize = gtk_button_realize;
widget_class->unrealize = gtk_button_unrealize;
@@ -755,16 +755,16 @@ gtk_button_init (GtkButton *button)
}
static void
gtk_button_destroy (GtkWidget *widget)
gtk_button_finalize (GObject *object)
{
GtkButton *button = GTK_BUTTON (widget);
GtkButton *button = GTK_BUTTON (object);
GtkButtonPrivate *priv = button->priv;
g_clear_pointer (&priv->label_text, g_free);
g_clear_object (&priv->gesture);
g_clear_object (&priv->gadget);
GTK_WIDGET_CLASS (gtk_button_parent_class)->destroy (widget);
G_OBJECT_CLASS (gtk_button_parent_class)->finalize (object);
}
static void
+2
View File
@@ -739,6 +739,8 @@ gtk_cell_editable_event_box_class_init (GtkCellEditableEventBoxClass *class)
g_object_class_install_property (object_class, PROP_PATH,
g_param_spec_string ("path", NULL, NULL,
NULL, GTK_PARAM_READWRITE));
gtk_widget_class_set_css_name (widget_class, "acceleditor");
}
static void
+1
View File
@@ -2024,6 +2024,7 @@ gtk_cell_renderer_text_start_editing (GtkCellRenderer *cell,
gtk_entry_set_has_frame (GTK_ENTRY (priv->entry), FALSE);
gtk_entry_set_alignment (GTK_ENTRY (priv->entry), xalign);
gtk_entry_set_width_chars (GTK_ENTRY (priv->entry), 5);
if (priv->text)
gtk_entry_set_text (GTK_ENTRY (priv->entry), priv->text);
+6 -3
View File
@@ -127,11 +127,11 @@ gtk_check_button_update_node_state (GtkWidget *widget)
* way to update the icon
*/
if (state & GTK_STATE_FLAG_CHECKED)
image_type = GTK_IS_RADIO_BUTTON (widget) ? GTK_CSS_IMAGE_BUILTIN_OPTION_CHECKED : GTK_CSS_IMAGE_BUILTIN_CHECK_CHECKED;
image_type = GTK_IS_RADIO_BUTTON (widget) ? GTK_CSS_IMAGE_BUILTIN_OPTION : GTK_CSS_IMAGE_BUILTIN_CHECK;
else if (state & GTK_STATE_FLAG_INCONSISTENT)
image_type = GTK_IS_RADIO_BUTTON (widget) ? GTK_CSS_IMAGE_BUILTIN_OPTION_INCONSISTENT : GTK_CSS_IMAGE_BUILTIN_CHECK_INCONSISTENT;
else
image_type = GTK_IS_RADIO_BUTTON (widget) ? GTK_CSS_IMAGE_BUILTIN_OPTION : GTK_CSS_IMAGE_BUILTIN_CHECK;
image_type = GTK_CSS_IMAGE_BUILTIN_NONE;
gtk_builtin_icon_set_image (GTK_BUILTIN_ICON (priv->indicator_gadget), image_type);
gtk_css_gadget_set_state (priv->indicator_gadget, state);
@@ -156,6 +156,8 @@ gtk_check_button_direction_changed (GtkWidget *widget,
gtk_box_gadget_reverse_children (GTK_BOX_GADGET (priv->gadget));
gtk_box_gadget_set_allocate_reverse (GTK_BOX_GADGET (priv->gadget),
gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
gtk_box_gadget_set_align_reverse (GTK_BOX_GADGET (priv->gadget),
gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
GTK_WIDGET_CLASS (gtk_check_button_parent_class)->direction_changed (widget, previous_direction);
}
@@ -182,6 +184,7 @@ gtk_check_button_add (GtkContainer *container,
pos = gtk_widget_get_direction (GTK_WIDGET (container)) == GTK_TEXT_DIR_RTL ? 0 : 1;
gtk_box_gadget_insert_widget (GTK_BOX_GADGET (priv->gadget), pos, widget);
gtk_box_gadget_set_gadget_expand (GTK_BOX_GADGET (priv->gadget), G_OBJECT (widget), TRUE);
}
static void
@@ -322,7 +325,7 @@ gtk_check_button_init (GtkCheckButton *check_button)
priv->gadget,
NULL);
gtk_builtin_icon_set_default_size_property (GTK_BUILTIN_ICON (priv->indicator_gadget), "indicator-size");
gtk_box_gadget_insert_gadget (GTK_BOX_GADGET (priv->gadget), 0, priv->indicator_gadget, FALSE, FALSE, GTK_ALIGN_BASELINE);
gtk_box_gadget_insert_gadget (GTK_BOX_GADGET (priv->gadget), 0, priv->indicator_gadget, FALSE, GTK_ALIGN_BASELINE);
gtk_check_button_update_node_state (GTK_WIDGET (check_button));
}
+2 -2
View File
@@ -373,10 +373,10 @@ gtk_color_editor_init (GtkColorEditor *editor)
if (gtk_widget_get_direction (editor->priv->h_slider) == GTK_TEXT_DIR_RTL)
gtk_style_context_add_class (gtk_widget_get_style_context (editor->priv->h_slider),
GTK_STYLE_CLASS_SCALE_HAS_MARKS_ABOVE);
"marks-before");
else
gtk_style_context_add_class (gtk_widget_get_style_context (editor->priv->h_slider),
GTK_STYLE_CLASS_SCALE_HAS_MARKS_BELOW);
"marks-after");
/* Create the scaled popup adjustments manually here because connecting user data is not
* supported by template GtkBuilder xml (it would be possible to set this up in the xml
+27 -10
View File
@@ -116,7 +116,7 @@
* ]|
*
* A GtkComboBox with an entry has a single CSS node with name combobox. It
* contains a bx with the .linked class and that box contains an entry and a
* contains a box with the .linked class. That box contains an entry and a
* button, both with the .combo class added.
* The button also contains another node with name arrow.
*/
@@ -276,6 +276,7 @@ static void gtk_combo_box_cell_editable_init (GtkCellEditableIface *iface)
static void gtk_combo_box_constructed (GObject *object);
static void gtk_combo_box_dispose (GObject *object);
static void gtk_combo_box_finalize (GObject *object);
static void gtk_combo_box_unmap (GtkWidget *widget);
static void gtk_combo_box_destroy (GtkWidget *widget);
static void gtk_combo_box_set_property (GObject *object,
@@ -705,6 +706,7 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
widget_class->get_preferred_height = gtk_combo_box_get_preferred_height;
widget_class->get_preferred_height_for_width = gtk_combo_box_get_preferred_height_for_width;
widget_class->get_preferred_width_for_height = gtk_combo_box_get_preferred_width_for_height;
widget_class->unmap = gtk_combo_box_unmap;
widget_class->destroy = gtk_combo_box_destroy;
widget_class->compute_expand = gtk_combo_box_compute_expand;
@@ -2304,15 +2306,15 @@ gtk_combo_box_menu_popup (GtkComboBox *combo_box,
guint32 activate_time)
{
GtkComboBoxPrivate *priv = combo_box->priv;
GtkTreePath *path;
gint active_item;
gint width, min_width, nat_width;
update_menu_sensitivity (combo_box, priv->popup_widget);
active_item = -1;
if (gtk_tree_row_reference_valid (priv->active_row))
{
GtkTreePath *path;
path = gtk_tree_row_reference_get_path (priv->active_row);
active_item = gtk_tree_path_get_indices (path)[0];
gtk_tree_path_free (path);
@@ -2327,6 +2329,7 @@ gtk_combo_box_menu_popup (GtkComboBox *combo_box,
if (priv->wrap_width == 0)
{
GtkAllocation content_allocation;
gint width, min_width, nat_width;
gtk_css_gadget_get_content_allocation (priv->gadget, &content_allocation, NULL);
width = content_allocation.width;
@@ -2384,6 +2387,8 @@ gtk_combo_box_grab_broken_event (GtkWidget *widget,
* This function is mostly intended for use by accessibility technologies;
* applications should have little use for it.
*
* Before calling this, @combo_box must be mapped, or nothing will happen.
*
* Since: 2.4
*/
void
@@ -2391,7 +2396,8 @@ gtk_combo_box_popup (GtkComboBox *combo_box)
{
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
g_signal_emit (combo_box, combo_box_signals[POPUP], 0);
if (gtk_widget_get_mapped (GTK_WIDGET (combo_box)))
g_signal_emit (combo_box, combo_box_signals[POPUP], 0);
}
/**
@@ -2409,7 +2415,7 @@ void
gtk_combo_box_popup_for_device (GtkComboBox *combo_box,
GdkDevice *device)
{
GtkComboBoxPrivate *priv = combo_box->priv;
GtkComboBoxPrivate *priv;
gint x, y, width, height;
GtkTreePath *path = NULL, *ppath;
GtkWidget *toplevel;
@@ -2418,6 +2424,8 @@ gtk_combo_box_popup_for_device (GtkComboBox *combo_box,
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
g_return_if_fail (GDK_IS_DEVICE (device));
priv = combo_box->priv;
if (!gtk_widget_get_realized (GTK_WIDGET (combo_box)))
return;
@@ -2539,10 +2547,12 @@ gtk_combo_box_real_popdown (GtkComboBox *combo_box)
void
gtk_combo_box_popdown (GtkComboBox *combo_box)
{
GtkComboBoxPrivate *priv = combo_box->priv;
GtkComboBoxPrivate *priv;
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
priv = combo_box->priv;
if (GTK_IS_MENU (priv->popup_widget))
{
gtk_menu_popdown (GTK_MENU (priv->popup_widget));
@@ -4071,7 +4081,7 @@ gtk_combo_box_set_model (GtkComboBox *combo_box,
priv = combo_box->priv;
if (model == combo_box->priv->model)
if (model == priv->model)
return;
gtk_combo_box_unset_model (combo_box);
@@ -4272,6 +4282,14 @@ gtk_combo_box_grab_focus (GtkWidget *widget)
gtk_widget_grab_focus (combo_box->priv->button);
}
static void
gtk_combo_box_unmap (GtkWidget *widget)
{
gtk_combo_box_popdown (GTK_COMBO_BOX (widget));
GTK_WIDGET_CLASS (gtk_combo_box_parent_class)->unmap (widget);
}
static void
gtk_combo_box_destroy (GtkWidget *widget)
{
@@ -4297,8 +4315,6 @@ gtk_combo_box_destroy (GtkWidget *widget)
_gtk_bin_set_child (GTK_BIN (combo_box), NULL);
}
gtk_combo_box_popdown (combo_box);
if (priv->row_separator_destroy)
priv->row_separator_destroy (priv->row_separator_data);
@@ -4955,11 +4971,12 @@ void
gtk_combo_box_set_entry_text_column (GtkComboBox *combo_box,
gint text_column)
{
GtkComboBoxPrivate *priv = combo_box->priv;
GtkComboBoxPrivate *priv;
GtkTreeModel *model;
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
priv = combo_box->priv;
model = gtk_combo_box_get_model (combo_box);
g_return_if_fail (text_column >= 0);
+3 -1
View File
@@ -573,7 +573,9 @@ gtk_compose_table_serialize (GtkComposeTable *compose_table,
(long long) (p - contents), total_length); \
g_free (contents); \
if (count) \
*count = 0; \
{ \
*count = 0; \
} \
return NULL; \
}
+10
View File
@@ -60,6 +60,16 @@ gtk_css_value_bg_size_compute (GtkCssValue *value,
if (value->y)
y = _gtk_css_value_compute (value->y, property_id, provider, style, parent_style);
if (x == value->x && y == value->y)
{
if (x)
_gtk_css_value_unref (x);
if (y)
_gtk_css_value_unref (y);
return _gtk_css_value_ref (value);
}
return _gtk_css_bg_size_value_new (value->x ? x : NULL,
value->y ? y : NULL);
}
+11 -6
View File
@@ -48,28 +48,33 @@ gtk_css_value_border_compute (GtkCssValue *value,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
GtkCssValue *values[4];
GtkCssValue *computed;
gboolean changed = FALSE;
guint i;
computed = _gtk_css_border_value_new (NULL, NULL, NULL, NULL);
computed->fill = value->fill;
for (i = 0; i < 4; i++)
{
if (value->values[i])
{
computed->values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style);
changed |= (computed->values[i] != value->values[i]);
values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style);
changed |= (values[i] != value->values[i]);
}
}
if (!changed)
{
_gtk_css_value_unref (computed);
for (i = 0; i < 4; i++)
{
if (values[i] != NULL)
_gtk_css_value_unref (values[i]);
}
return _gtk_css_value_ref (value);
}
computed = _gtk_css_border_value_new (values[0], values[1], values[2], values[3]);
computed->fill = value->fill;
return computed;
}
+4 -3
View File
@@ -890,7 +890,8 @@ gtk_css_gadget_draw (GtkCssGadget *gadget,
#if G_ENABLE_DEBUG
{
GdkDisplay *display = gtk_widget_get_display (gtk_css_gadget_get_owner (gadget));
if (GTK_DISPLAY_DEBUG_CHECK (display, LAYOUT))
GtkDebugFlag flags = gtk_get_display_debug_flags (display);
if G_UNLIKELY (flags & GTK_DEBUG_LAYOUT)
{
cairo_save (cr);
cairo_new_path (cr);
@@ -912,7 +913,7 @@ gtk_css_gadget_draw (GtkCssGadget *gadget,
cairo_stroke (cr);
cairo_restore (cr);
}
if (GTK_DISPLAY_DEBUG_CHECK (display, BASELINES))
if G_UNLIKELY (flags & GTK_DEBUG_BASELINES)
{
int baseline = priv->allocated_baseline;
@@ -926,7 +927,7 @@ gtk_css_gadget_draw (GtkCssGadget *gadget,
}
cairo_save (cr);
cairo_new_path (cr);
cairo_move_to (cr, x + margin.left, priv->allocated_baseline + 0.5);
cairo_move_to (cr, x + margin.left, baseline + 0.5);
cairo_rel_line_to (cr, width - margin.left - margin.right, 0);
cairo_set_line_width (cr, 1.0);
cairo_set_source_rgba (cr, 1.0, 0, 0.25, 0.25);
+16 -87
View File
@@ -45,39 +45,22 @@ gtk_css_image_builtin_draw_check (GtkCssImage *image,
gboolean inconsistent)
{
GtkCssImageBuiltin *builtin = GTK_CSS_IMAGE_BUILTIN (image);
gint x, y, exterior_size, interior_size, thickness, pad;
gint x, y, exterior_size, interior_size, pad;
exterior_size = MIN (width, height);
if (exterior_size % 2 == 0) /* Ensure odd */
exterior_size -= 1;
/* FIXME: thickness */
thickness = 1;
pad = thickness + MAX (1, (exterior_size - 2 * thickness) / 9);
pad = 1 + MAX (1, (exterior_size - 2) / 9);
interior_size = MAX (1, exterior_size - 2 * pad);
if (interior_size < 7)
{
interior_size = 7;
pad = MAX (0, (exterior_size - interior_size) / 2);
}
pad = MAX (0, (exterior_size - interior_size) / 2);
x = - (1 + exterior_size - (gint) width) / 2;
y = - (1 + exterior_size - (gint) height) / 2;
if (builtin->border_width > 0)
{
cairo_set_line_width (cr, builtin->border_width);
cairo_rectangle (cr, x + 0.5, y + 0.5, exterior_size - 1, exterior_size - 1);
gdk_cairo_set_source_rgba (cr, &builtin->bg_color);
cairo_fill_preserve (cr);
gdk_cairo_set_source_rgba (cr, &builtin->border_color);
cairo_stroke (cr);
}
gdk_cairo_set_source_rgba (cr, &builtin->fg_color);
if (inconsistent)
@@ -95,6 +78,7 @@ gtk_css_image_builtin_draw_check (GtkCssImage *image,
{
if (checked)
{
cairo_save (cr);
cairo_translate (cr,
x + pad, y + pad);
@@ -123,6 +107,7 @@ gtk_css_image_builtin_draw_check (GtkCssImage *image,
7.0, 0.0);
cairo_fill (cr);
cairo_restore (cr);
}
}
}
@@ -136,7 +121,7 @@ gtk_css_image_builtin_draw_option (GtkCssImage *image,
gboolean inconsistent)
{
GtkCssImageBuiltin *builtin = GTK_CSS_IMAGE_BUILTIN (image);
gint x, y, exterior_size, interior_size, thickness, pad;
gint x, y, exterior_size, interior_size, pad;
exterior_size = MIN (width, height);
@@ -146,42 +131,18 @@ gtk_css_image_builtin_draw_option (GtkCssImage *image,
x = - (1 + exterior_size - width) / 2;
y = - (1 + exterior_size - height) / 2;
if (builtin->border_width > 0)
{
cairo_set_line_width (cr, builtin->border_width);
cairo_new_sub_path (cr);
cairo_arc (cr,
x + exterior_size / 2.,
y + exterior_size / 2.,
(exterior_size - 1) / 2.,
0, 2 * G_PI);
gdk_cairo_set_source_rgba (cr, &builtin->bg_color);
cairo_fill_preserve (cr);
gdk_cairo_set_source_rgba (cr, &builtin->border_color);
cairo_stroke (cr);
}
gdk_cairo_set_source_rgba (cr, &builtin->fg_color);
/* FIXME: thickness */
thickness = 1;
pad = 1 + MAX (1, 2 * (exterior_size - 2) / 9);
interior_size = MAX (1, exterior_size - 2 * pad);
if (interior_size < 7)
pad = MAX (0, (exterior_size - interior_size) / 2);
if (inconsistent)
{
gint line_thickness;
pad = thickness + MAX (1, (exterior_size - 2 * thickness) / 9);
interior_size = MAX (1, exterior_size - 2 * pad);
if (interior_size < 7)
{
interior_size = 7;
pad = MAX (0, (exterior_size - interior_size) / 2);
}
line_thickness = MAX (1, (3 + interior_size * 2) / 7);
cairo_rectangle (cr,
@@ -191,17 +152,8 @@ gtk_css_image_builtin_draw_option (GtkCssImage *image,
line_thickness);
cairo_fill (cr);
}
if (checked)
else if (checked)
{
pad = thickness + MAX (1, 2 * (exterior_size - 2 * thickness) / 9);
interior_size = MAX (1, exterior_size - 2 * pad);
if (interior_size < 5)
{
interior_size = 7;
pad = MAX (0, (exterior_size - interior_size) / 2);
}
cairo_new_sub_path (cr);
cairo_arc (cr,
x + pad + interior_size / 2.,
@@ -353,10 +305,7 @@ gtk_css_image_builtin_draw_expander (GtkCssImage *image,
gdk_cairo_set_source_rgba (cr, &builtin->fg_color);
cairo_fill_preserve (cr);
gdk_cairo_set_source_rgba (cr, &builtin->border_color);
cairo_stroke (cr);
cairo_fill (cr);
}
static void
@@ -809,27 +758,11 @@ gtk_css_image_builtin_compute (GtkCssImage *image,
GtkCssStyle *parent_style)
{
GtkCssImageBuiltin *result;
GtkBorderStyle border_style;
result = g_object_new (GTK_TYPE_CSS_IMAGE_BUILTIN, NULL);
border_style = _gtk_css_border_style_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_STYLE));
if (border_style == GTK_BORDER_STYLE_SOLID)
{
GtkBorder border;
border.top = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100);
border.right = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH), 100);
border.bottom = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH), 100);
border.left = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH), 100);
result->border_width = MIN (MIN (border.top, border.bottom),
MIN (border.left, border.right));
}
result->fg_color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR));
result->bg_color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BACKGROUND_COLOR));
result->border_color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_COLOR));
return GTK_CSS_IMAGE (result);
}
@@ -842,9 +775,7 @@ gtk_css_image_builtin_equal (GtkCssImage *image1,
GtkCssImageBuiltin *builtin2 = GTK_CSS_IMAGE_BUILTIN (image2);
return gdk_rgba_equal (&builtin1->fg_color, &builtin2->fg_color)
&& gdk_rgba_equal (&builtin1->bg_color, &builtin2->bg_color)
&& gdk_rgba_equal (&builtin1->border_color, &builtin2->border_color)
&& builtin1->border_width == builtin2->border_width;
&& gdk_rgba_equal (&builtin1->bg_color, &builtin2->bg_color);
}
static void
@@ -912,19 +843,17 @@ gtk_css_image_builtin_draw (GtkCssImage *image,
case GTK_CSS_IMAGE_BUILTIN_NONE:
break;
case GTK_CSS_IMAGE_BUILTIN_CHECK:
case GTK_CSS_IMAGE_BUILTIN_CHECK_CHECKED:
case GTK_CSS_IMAGE_BUILTIN_CHECK_INCONSISTENT:
gtk_css_image_builtin_draw_check (image, cr,
width, height,
image_type == GTK_CSS_IMAGE_BUILTIN_CHECK_CHECKED,
image_type == GTK_CSS_IMAGE_BUILTIN_CHECK,
image_type == GTK_CSS_IMAGE_BUILTIN_CHECK_INCONSISTENT);
break;
case GTK_CSS_IMAGE_BUILTIN_OPTION:
case GTK_CSS_IMAGE_BUILTIN_OPTION_CHECKED:
case GTK_CSS_IMAGE_BUILTIN_OPTION_INCONSISTENT:
gtk_css_image_builtin_draw_option (image, cr,
width, height,
image_type == GTK_CSS_IMAGE_BUILTIN_OPTION_CHECKED,
image_type == GTK_CSS_IMAGE_BUILTIN_OPTION,
image_type == GTK_CSS_IMAGE_BUILTIN_OPTION_INCONSISTENT);
break;
case GTK_CSS_IMAGE_BUILTIN_ARROW_UP:
-2
View File
@@ -41,8 +41,6 @@ struct _GtkCssImageBuiltin
GdkRGBA fg_color;
GdkRGBA bg_color;
GdkRGBA border_color;
int border_width;
};
struct _GtkCssImageBuiltinClass
+22
View File
@@ -227,6 +227,27 @@ gtk_css_image_cross_fade_print (GtkCssImage *image,
g_string_append (string, ")");
}
static GtkCssImage *
gtk_css_image_cross_fade_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
GtkCssImageCrossFade *cross_fade = GTK_CSS_IMAGE_CROSS_FADE (image);
GtkCssImage *start, *end, *computed;
start = _gtk_css_image_compute (cross_fade->start, property_id, provider, style, parent_style);
end = _gtk_css_image_compute (cross_fade->end, property_id, provider, style, parent_style);
computed = _gtk_css_image_cross_fade_new (start, end, cross_fade->progress);
g_object_unref (start);
g_object_unref (end);
return computed;
}
static void
gtk_css_image_cross_fade_dispose (GObject *object)
{
@@ -250,6 +271,7 @@ _gtk_css_image_cross_fade_class_init (GtkCssImageCrossFadeClass *klass)
image_class->draw = gtk_css_image_cross_fade_draw;
image_class->parse = gtk_css_image_cross_fade_parse;
image_class->print = gtk_css_image_cross_fade_print;
image_class->compute = gtk_css_image_cross_fade_compute;
object_class->dispose = gtk_css_image_cross_fade_dispose;
}
+2 -2
View File
@@ -74,7 +74,7 @@ gtk_css_image_fallback_draw (GtkCssImage *image,
if (fallback->color)
gdk_cairo_set_source_rgba (cr, _gtk_css_rgba_value_get_rgba (fallback->color));
else
cairo_set_source_rgb (cr, 1, 0, 9);
cairo_set_source_rgb (cr, 1.0, 0.0, 0.0);
cairo_rectangle (cr, 0, 0, width, height);
cairo_fill (cr);
@@ -85,7 +85,7 @@ gtk_css_image_fallback_draw (GtkCssImage *image,
static void
gtk_css_image_fallback_print (GtkCssImage *image,
GString *string)
GString *string)
{
GtkCssImageFallback *fallback = GTK_CSS_IMAGE_FALLBACK (image);
int i;
+11
View File
@@ -593,6 +593,10 @@ gtk_css_node_class_init (GtkCssNodeClass *klass)
_gtk_marshal_VOID__OBJECT_OBJECT,
G_TYPE_NONE, 2,
GTK_TYPE_CSS_NODE, GTK_TYPE_CSS_NODE);
g_signal_set_va_marshaller (cssnode_signals[NODE_ADDED],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__OBJECT_OBJECTv);
cssnode_signals[NODE_REMOVED] =
g_signal_new (I_("node-removed"),
G_TYPE_FROM_CLASS (object_class),
@@ -602,6 +606,10 @@ gtk_css_node_class_init (GtkCssNodeClass *klass)
_gtk_marshal_VOID__OBJECT_OBJECT,
G_TYPE_NONE, 2,
GTK_TYPE_CSS_NODE, GTK_TYPE_CSS_NODE);
g_signal_set_va_marshaller (cssnode_signals[NODE_REMOVED],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__OBJECT_OBJECTv);
cssnode_signals[STYLE_CHANGED] =
g_signal_new (I_("style-changed"),
G_TYPE_FROM_CLASS (object_class),
@@ -611,6 +619,9 @@ gtk_css_node_class_init (GtkCssNodeClass *klass)
_gtk_marshal_VOID__POINTER,
G_TYPE_NONE, 1,
G_TYPE_POINTER);
g_signal_set_va_marshaller (cssnode_signals[STYLE_CHANGED],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__POINTERv);
cssnode_properties[PROP_CLASSES] =
g_param_spec_boxed ("classes", P_("Style Classes"), P_("List of classes"),
+5 -5
View File
@@ -1484,11 +1484,11 @@ parse_declaration (GtkCssScanner *scanner,
!_gtk_css_parser_begins_with (scanner->parser, '}') &&
!_gtk_css_parser_is_eof (scanner->parser))
{
gtk_css_provider_error_literal (scanner->provider,
scanner,
GTK_CSS_PROVIDER_ERROR,
GTK_CSS_PROVIDER_ERROR_SYNTAX,
"Junk at end of value");
gtk_css_provider_error (scanner->provider,
scanner,
GTK_CSS_PROVIDER_ERROR,
GTK_CSS_PROVIDER_ERROR_SYNTAX,
"Junk at end of value for %s", property->name);
_gtk_css_parser_resync (scanner->parser, TRUE, '}');
gtk_css_scanner_pop_section (scanner, GTK_CSS_SECTION_VALUE);
gtk_css_scanner_pop_section (scanner, GTK_CSS_SECTION_DECLARATION);

Some files were not shown because too many files have changed in this diff Show More