Commit Graph

29298 Commits

Author SHA1 Message Date
Matthias Clasen
9e5f4f94b3 immulticontext: Avoid GdkScreen api
No need for it here either.
2017-10-30 19:30:29 -04:00
Matthias Clasen
297889e080 immodule: Avoid GdkScreen api
Another place where it is not needed.
2017-10-30 19:27:36 -04:00
Matthias Clasen
24903e3fab modules: Avoid GdkScreen api
No need for this here either.
2017-10-30 19:19:38 -04:00
Matthias Clasen
0cd864283f assistant: Avoid GdkScreen api
There is no need at all here to use gtk_settings_get_for_screen.
2017-10-30 19:19:38 -04:00
Matthias Clasen
a1a5f556cb Some documentation updates
Document gtk_settings_get_for_display instead of for_screen.
2017-10-30 18:59:41 -04:00
Matthias Clasen
e821c2fc2f gtk: Avoid using gdk_screen_get_setting
We can get the setting from the display instead.
2017-10-30 16:51:20 -04:00
Matthias Clasen
f9cc7ca140 Add gtk_settings_get_for_display
This will help us avoiding screens in many places.
2017-10-30 16:50:14 -04:00
Matthias Clasen
a518072e87 Remove GdkScreen api usage
Use GdkDisplay equivalents where they exist.
2017-10-30 16:06:42 -04:00
Matthias Clasen
1f22c6532e Store the display inside GtkSettings
This is a step towards dropping GdkScreen.
2017-10-30 15:56:03 -04:00
Matthias Clasen
2926669a9b gtk: Stop handling settings events
We don't need this anymore, now that we use the ::setting-changed
signal.
2017-10-30 09:48:51 -04:00
Matthias Clasen
a8aff6ef8f gtk: Connect to GdkDisplay::setting-changed
We still handle the setting event, for now.
That will be removed in a future commit.
2017-10-30 09:29:54 -04:00
Benjamin Otte
916981f66e cssimagescaled: Remove now unused struct member 2017-10-30 02:55:46 +01:00
Benjamin Otte
481189867a inspector: Use the new monitor change signals
And on't use the GdkScreen anymore now that the GdkDisplay provides all
the information we care about.
2017-10-30 02:30:44 +01:00
Timm Bäder
91f40eb088 widget: Make parent property read-only 2017-10-29 18:03:10 +01:00
Timm Bäder
09239eb670 widget: Don't notify :parent when rearranging widgets
gtk_widget_reposition_after is also valid to call if the widget already
has a parent, so don't notify the parent property in that case.
2017-10-29 17:27:53 +01:00
Timm Bäder
ff6cd8f75e widget: Remove parent-set signal
When a widget unparents its child widget manually in finalize, this can
lead to the parent-set signal being emitted for those child widgets. The
parent already has a ref_count of 0 though, so it can't be used in a
meaningful way. Specifically, emitting the signal will already try to
ref the parent which prints a critical.

Since GtkWidget already has a "parent" property, one can use its notify
signal instead to get notified when the parent widget changes.
2017-10-29 17:24:12 +01:00
Timm Bäder
0be4166b89 inspector: Remove node != NULL check from recorder model
We use NULL to remove the selection.
2017-10-29 13:44:12 +01:00
Timm Bäder
8b0f60bb6f checkbutton: Destroy indicator widget when draw-indicator is FALSE 2017-10-29 13:27:03 +01:00
Benjamin Otte
457bd2b9ee cssimagescaled: Just return the computed image
... instead of returning either itself with uncomputed images or a
copy of itself with only one computed image and lots of other
uncomputed images that we're never gonna look at again.

This fixes expressions like -gtk-scaled(-gtk-recolor(...),-gtk-recolor(...))
which Adwaita uses for checkmarks and bullets.
2017-10-29 06:41:12 -04:00
Matthias Clasen
598d22d194 Avoid creating trivial shadow nodes
The Vulkan renderer creates a fallback surface for each shadow
node, even if we end up not rendering anything to it. Avoiding
this is a nice optimization.
2017-10-28 16:10:46 -04:00
Matthias Clasen
99d3d31314 Adwaita: Use scaled icons for checks and bullets
This gives us crip rendering on hidpi screens.
2017-10-28 15:22:54 -04:00
Matthias Clasen
1dbc50f3f8 Adwaita: Add scaled version of bullets and checks
We use these assets as .symbolic.png now, so for hidpi, we
should provide @2 variants.
2017-10-28 15:20:11 -04:00
Matthias Clasen
a48015d3c6 inspector: Show details for shadow nodes
One of the few node types that we're not detailing yet.
2017-10-28 14:30:03 -04:00
Matthias Clasen
dc0570cc17 gsk: Drop the GskRenderer::scale-factor property
This is can always be obtained from the window that is already
associated with the renderer, no need to maintain a separate
property for it.
2017-10-28 11:49:39 -04:00
Timm Bäder
50d9484083 Adwaita: Add back visible focus outlines for list rows 2017-10-28 11:46:35 +02:00
Timm Bäder
4dee08dd52 sizerequest: Don't pass uninitialized values to measure
The GtkWidgetClass::measure vfunc is not required to assign a value to
any of the (out) parameters, so we need to initialize the locals we pass
to it, otherwise we can end up with a garbage size request.
2017-10-28 11:42:08 +02:00
Federico Mena Quintero
559d32420c GtkPathBar: Centralize handling of outstanding cancellables
The path bar would crash if we disposed it before all pending I/O
operations had finished.  Now we remember all the outstanding
operations directly in the GtkPathBarPrivate, and deal with them
consistently.
2017-10-27 17:18:38 -05:00
Matthias Clasen
ea91ab1d99 gsk: Make text nodes more compact
The copy of the PangoGlyphString we do here was showing up
in some profiles. To avoid it, allocate the PangoGlyphInfo array
as part of the node itself. Update all callers to deal with
the slight api change required for this.
2017-10-27 17:13:40 -04:00
Simon McVittie
bdd2ca9a60 GtkHeaderBar: Reconsider buttons if any tiling state changes
Looking at the 1-bit "tiled or not?" state is not necessarily
enough.

Signed-off-by: Simon McVittie <smcv@debian.org>

https://bugzilla.gnome.org/show_bug.cgi?id=789357
2017-10-27 12:14:44 -02:00
Drew DeVault
1b279e3d4a Wayland: Implement KDE's SSD protocol
If the compositor prefers server-side decorations and the client doesn't
customize the title bar, we disable client-side decorations and let the
compositor know. Otherwise, we continue to use client-side decorations.

Signed-off-by: Drew DeVault <sir@cmpwn.com>

https://bugzilla.gnome.org/show_bug.cgi?id=781909
2017-10-26 15:51:56 -04:00
Florian Müllner
07beb6dba2 appchooserwidget: Don't limit application list unconditionally
As documented, GtkAppChooser is "typically [used] for the purpose of
opening a file". However given that applications that support neither
opening files nor URLs are filtered out, the chooser is not actual
useful for any other (atypical) usage. Change that by only applying
the filtering if a content-type was set, and use the full unfiltered
list otherwise.

https://bugzilla.gnome.org/show_bug.cgi?id=789327
2017-10-26 06:18:01 -04:00
Christian Persch
29d1cc2fcd actionable: Allow all detailed action name formats
Use g_action_parse_detailed_name() to enable use of this API
for actions with non-string parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=788841
2017-10-26 06:16:59 -04:00
Matthias Clasen
5bdc67f3f6 Drop gtk_cell_renderer_get_size
This function has been deprecated since 3.0, time to drop it.
2017-10-25 22:27:19 -04:00
Matthias Clasen
fb8589671d Drop unused includes of gtkrender.h
We don't use the gtk_render apis internally anymore.
Drop these includes so it is clear where the remaining
uses are.
2017-10-25 21:46:46 -04:00
Matthias Clasen
f8e74e8f04 Some minimal theme fixes for focus drawing
We don't want focus rectangles everywhere, so set them up
explicitly for the widgets where we want them, and only
if focus(visible) is set.
2017-10-25 18:35:32 -04:00
Matthias Clasen
46d4deeb1e Remove a shortcut in gtk_widget_set_focus_child
Since focus can now be represented by more than one state,
just looking at the focus_child is no longer sufficient - we
may fail to propagate :focus(visible) if we do so. For now,
just remove the shortcut and always do the work.
2017-10-25 18:26:06 -04:00
Matthias Clasen
0d4bd034c6 Always draw outline
We can now control with CSS where there the outline
is drawn.
2017-10-25 17:59:00 -04:00
Matthias Clasen
4209c1762d Support the new state in CSS selectors
Make :focus(visible) match the new state.
2017-10-25 17:59:00 -04:00
Matthias Clasen
8b15eabad2 Set the new state flag
For now, we only set the new visible focus state
on the focus widget, when we have visible focus.
Later on, we will allow setting it on other widgets.
2017-10-25 17:49:43 -04:00
Matthias Clasen
18b8a7f91f Add a state flag for visible focus
The new flag is called GTK_STATE_FLAGS_FOCUS_VISIBLE.
2017-10-25 17:49:43 -04:00
Timm Bäder
0d82de585c Adwaita: Remove focus outlines from scrollbars and scales
gtk3 didn't have focus outlines for these, so remove them for now.

Sorry lapo.
2017-10-25 09:34:52 +02:00
Chun-wei Fan
20fc576275 gtk/gtkcssenumvalue.c: Deal with __builtin_popcount on MSVC
__builtin_popcount is a GCCism that is used to count the number of bits
involved, which means any non GCC/CLang compilers won't like the code,
meaning that on MSVC builds we must implement it ourselves.

We first use __cpuid() to check whether the CPU supports the popcount
instruction, if it does, we use the __popcnt intrinsic, otherwise
(untested, since I don't have a system that does not have the
instruction), we use the suggested hacks at
http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-10-25 00:53:37 +08:00
Chun-wei Fan
a601e5d10e gtk/gtkwin32theme.c: Include gdk/gdkprivate.h
We still need to access the GdkEvent structure here directly, as using
the GdkEvent getters is likely not worth the trouble involved.

Please see Emmanuele's comment (#97) of the following bug URL.

https://bugzilla.gnome.org/show_bug.cgi?id=773299
2017-10-25 00:48:01 +08:00
Benjamin Otte
373b407bd2 Fix build
Don't do two things at once and forget to run ninja before pushing.
2017-10-24 18:26:08 +02:00
Benjamin Otte
8549e62d85 Add default return values to switch statements
We are using g_assert_not_reached() without doing anything, assuming it
aborts the program. In release builds however, it is ignored.
2017-10-24 18:21:03 +02:00
Matthias Clasen
6c74a8c755 inspector: Show more render node details
Should clip and container node details.
2017-10-24 15:24:23 +02:00
Alexander Larsson
96b04836d8 Drop all uses of GdkPixbufAnimation in the gtk APIs
These are basically animated gifs, and don't fit well in how
modern things animate.
2017-10-23 16:56:49 +02:00
Alexander Larsson
b1250935a0 GtkIconHelper: Remove unused code 2017-10-23 15:34:17 +02:00
Alexander Larsson
0089e4ad58 Drop pixbuf support in IconHelper and ImageDefinition
These are no longer used, instead we always covert to surface as
early as possible and drop the pixbuf.

This means we never store both the pixbuf and the surface at
for any longer time, which is wasteful. Also, its one step further
to drop GdkPixbufs from generic use in our APIs.
2017-10-23 15:28:33 +02:00
Alexander Larsson
61b2ab5d90 GtkDragSource: Don't use gtk_image_definition_new_pixbuf
We want to get rid of pixbuf image definitions.

Long term this should probably be gtk_drag_source_set_icon_surface instead.
2017-10-23 15:28:33 +02:00