Commit Graph

1512 Commits

Author SHA1 Message Date
Benjamin Otte
bbbe39fb44 icontheme: Make text direction a lookup argument
Most users were just forgetting to set the proper flags.
And flags aren't the right way to set this anyway, it was just
acceptable as a workaround during GTK3 to not break API.
2020-02-04 16:41:36 +01:00
Benjamin Otte
bfebc2b01a icontheme: Remove gtk_icon_theme_get_default()
The API encouraged wrong usage - most of the users were indeed wrong.

Use the correct version instead:
  gtk_icon_theme_get_for_display (gtk_widget_get_display ())
2020-02-04 16:41:36 +01:00
Alexander Larsson
b087f9ca51 icon-theme: Drop the _for_scale() versions and always take scale 2020-01-30 10:53:43 +01:00
Alexander Larsson
e2f778602b icon-theme: Rename GtkIconInfo to GtkIcon 2020-01-30 10:53:43 +01:00
Alexander Larsson
dbe021239f icons: Convert use of load() to download_texture() 2020-01-29 19:06:16 +01:00
Alexander Larsson
c42977af04 Convert trivial users of icon theme loading to use info as paintable 2020-01-29 19:06:16 +01:00
Benjamin Otte
146b921246 cssnode: Convert name + id from interned string to GQuark
The reason for this is simply that I want to get hash functions that
have their values close together, so they can fit in a smaller range
(the goal here is 12 bits). By using GQuark, we get consecutive numbers
starting with 1 (and applications have <1000 quarks usually), whereas
interned strings can be all over the place.

As a side effect we also save 64 bytes per declaration.
2020-01-28 02:17:03 +01:00
Timm Bäder
4287f0def4 window: Replace GtkStyleContext use to get surface transform
We have GtkCssBoxes for this these days.
2020-01-26 18:21:07 +01:00
Matthias Clasen
119457279b window: Rename a profiler mark
The "layout" name was already taken for the frame clock
phase by that name. Oops.
2020-01-22 15:12:03 -05:00
Matthias Clasen
8cb375de11 window: Add a profiler mark around size allocation
This give a high-level entry for the duration of size allocation
in the frame cycle.
2020-01-21 23:43:01 -05:00
Timm Bäder
45455f1bdb Remove GtkCssShadowsValue
Previously, we wrapped all GtkCssShadowValues in a GtkCssShadowsValue,
even if it was just one shadow. This causes an unnecessary bloat in
css values.

Make each GtkCssShadowValue able to handle multiple shadows instead, and
use gtk_css_shadow_value* API everywhere.
2020-01-18 08:49:52 +01:00
Timm Bäder
67991ed0f4 Remove GtkCssRgbaValue
The differenciation between a literal color value and an RGBA value
caused problems in various situations. Just treat the two the same but
don't allow access to the rgba value of a non-literal color value.

This gets rid of around 1.6k rgba values in the widget-factory.
2020-01-18 08:49:51 +01:00
Matthias Clasen
e9067ae2db Replace gtk_drop_target_attach/detach
Since drop targets are now just event controller,
gtk_widget_add/remove_controller works just fine
for them.
2020-01-08 18:48:21 -05:00
Matthias Clasen
46f42fc53d droptarget: Drop defaults flags
These no longer have any effect.

Update all callers.
2020-01-08 18:48:20 -05:00
Matthias Clasen
802c7975e2 window: Port to GtkDragDest 2020-01-08 18:48:20 -05:00
Timm Bäder
726909d735 Window: Avoid some redundant assignments 2020-01-07 17:27:18 +01:00
Matthias Clasen
baf99bb868 Remove gtk_window_set_hardcoded_surface
It is not used anymore.
2019-12-30 00:31:32 -05:00
Matthias Clasen
3d4acf6360 window: Move F10 handling to popover menubars 2019-12-29 18:44:26 -05:00
Matthias Clasen
6f80eee962 window: Complete the popover conversion 2019-12-29 17:10:16 -05:00
Matthias Clasen
a73947e54f Remove more mir remnants
The mir backend was removed a while ago, so
GDK_WINDOWING_MIR is never defined.
2019-12-28 21:52:34 -05:00
Matthias Clasen
917181cb67 window: Get rid of the inspector_window static
Use the new per-display inspector plumbing and
stop relying on a static variable.
2019-12-07 14:59:49 -05:00
Matthias Clasen
a207a4b3cd inspector: Attach inspector window to display
Give the inspector window a ::inspected-display
property, and pass a display when obtaining an
inspector window. Update the caller.
2019-12-07 14:59:49 -05:00
Matthias Clasen
39a1d27960 window: Inspector cleanups
Reduce the use of the inspector_window static.
The goal is to have one inspector window per
display, so we need to get rid of the static.
2019-12-07 14:59:49 -05:00
Matthias Clasen
5ef4a64084 window: Remove inspector updating fully
Commit 05e752e096 left some ruins behind.
Clean that up.
2019-12-07 14:59:49 -05:00
Matthias Clasen
baacd9efbf inspector: Init yourself
No need to have GTK call this from the outside.
2019-12-07 14:59:49 -05:00
Timm Bäder
83ec7d562a window: Don't set invalid csd input shape
This might happen if the CSS values of the decoration node are broken,
e.g. if people *accidentally* type large negative values for the
margins.

Fixes #2268
2019-12-03 08:40:34 +01:00
Alberts Muktupāvels
e81a90c432 window: fix opaque region
Decoration node for drawing is used only for client side decorated
windows, but corners from opaque region is subtracted also for
normal windows.

Rename function to better reflect what it does and do not subtract
corners if decoration node was not used for drawing.
2019-11-30 20:19:26 +02:00
Matthias Clasen
d4180931f8 Merge branch 'seal-popover-menu' into 'master'
Privatize popover menu pieces

See merge request GNOME/gtk!925
2019-11-18 01:57:55 +00:00
Emmanuele Bassi
b70e4f6de9 Rename "iconify" to "minimize"
The "iconified" state is mostly an X11-ism; every other platform calls
this state "minimized" because it may not involve turning a window into
an icon at all.
2019-11-16 20:07:37 +00:00
Matthias Clasen
bfa0509f08 Privatize popover menu pieces
Don't allow manual creation of popover menus
anymore. This lets us also make GtkModelButton
private
2019-11-11 12:42:06 +01:00
Matthias Clasen
0284d40e24 window: Unrealize renderer before children
Unrealize the GSK renderer before destroying children.
This makes the renderer drop any texture caches that
it might have, so that we don't needlessly download
them when releasing the widget-side holder objects.

As a fortunate side effect, this fixes crashes on
exit with GtkGLArea-containing windows under Wayland.
2019-10-22 20:28:28 -04:00
Matthias Clasen
5a93449b89 window: Make fallback menu a popover
We want to phase out menus.
2019-09-16 07:23:17 -04:00
Alexander Larsson
96b37f4eb8 Use the new GtkBuildableParser type in GtkBuildable interfaces 2019-09-10 12:08:20 -04:00
Timm Bäder
71339225eb icontheme: Remove gtk_icon_info_load_texture
It's the same as load_icon now.
2019-09-09 17:36:26 +02:00
Timm Bäder
6821fe0c13 icontheme: Add error argument to _load_texture
Loading an icon might fail.
2019-09-09 17:36:26 +02:00
Timm Bäder
18714e25a8 window: Remove useless deprecation guards
gtk_window_present() is not deprecated.
2019-09-09 17:36:24 +02:00
Timm Bäder
b2e94f81cf window: Remove some leftover event code 2019-08-03 14:44:25 +02:00
Ray Strode
1612e38cda window: sort icons before adding to _NET_WM_ICON
When processing the list of icons for a window to add them to
_NET_WM_ICON gdk_x11_surface_set_icon_list only adds as many
icon sizes as will fit within X protocol limits.

It achieves this by keeping a running total of the number of
bytes taken up by icons already processed and bails as soon
as it goes over the limit.

The problem is, one 512x512 icon is already over the limit,
and so no icons will get added at all if the first icon in
list is 512x512.

Indeed, the code seems to assume the list is sorted from smallest
icon to biggest icon.

This commit changes the caller to sort the list.
2019-08-01 16:48:58 -04:00
Timm Bäder
b2d639b6d9 window: Unroot with old display
Things might rely on the old display being set while unrooting.

Fixes #2052
2019-07-27 07:57:06 +02:00
Timm Bäder
8f734b01b2 window: Plug a GList leak
We need to free the GList manually when using g_list_remove_link().
2019-07-21 12:45:10 +02:00
Timm Bäder
8beea4d958 window: Merge some functions into their only callers
So it's clear we only add or remove the pointerfocus-es in
_update_pointer_focus.
2019-07-21 11:06:24 +02:00
Timm Bäder
264d4bada6 widget: Remove queue_resize_no_redraw
We always invalidate the widget in size_allocate() anyway.
2019-07-07 07:43:08 +02:00
Emmanuele Bassi
e07098da03 window: Create a GtkConstraintSolver
Implement the GtkRoot getter for GtkConstraintSolver.
2019-06-30 23:42:44 +01:00
Matthias Clasen
996f011ed8 window: Fix the default value of mnemonics-visible
They aren't visible, so why should the property
be TRUE?
2019-06-23 10:59:17 -04:00
Matthias Clasen
7e73da5f73 widget: Add parameter type back to install_action
Adapt all callers.
2019-06-22 16:48:16 -04:00
Matthias Clasen
9b0d87c5a7 window: Cosmetics 2019-06-21 02:55:27 +00:00
Matthias Clasen
dee9e40ad3 Build fix 2019-06-20 22:47:35 -04:00
Matthias Clasen
a933a9bc79 Fix initial mnemonic visibility
We were showing mnemonics initially, which is not desired.
2019-06-21 02:38:05 +00:00
Matthias Clasen
6a4a082660 main: Move visible mnemonics handling
No need to special-case this anymore; we can use
a regular event controller in GtkWindow for this.
2019-06-21 02:37:51 +00:00
Matthias Clasen
a7cdcdf92c main: Move visible focus handling
No need to special-case this anymore; we can use
a regular event controller in GtkWindow for this.
2019-06-21 02:37:12 +00:00