call_end

    • chevron_right

      Marcus Lundblad: Midsommer Maps

      news.movim.eu / PlanetGnome • 18 June • 4 minutes

    As tradition has it, it's about time for the (Northern Hemisphere) summer update on the happenings around Maps!

    about-49.alpha.png
    About dialog for GNOME Maps 49.alpha development


    Bug Fixes

    Since the GNOME 48 release in March, there's been some bug fixes, such as correctly handling daylight savings time in public transit itineraries retrieved from Transitous. Also James Westman fixed a regression where the search result popover wasn't showing on small screen devices (phones) because of sizing issues.

    More Clickable Stuff

    More symbols can now be directly selected in the map view by clicking/tapping on there symbols, like roads and house numbers (and then also, like any other POI can be marked as favorites).
    place-bubble-road.png
    Showing place information for the AVUS motorway in Berlin

    And related to traffic and driving, exit numbers are now shown for highway junctions (exits) when available.
    motorway-exit-right.png
    Showing information for a highway exit in a driving-on-the-right locallity

    motorway-exit-left.png
    Showing information for a highway exit in a driving-on-the-left locallity

    Note how the direction the arrow is pointing depends on the side of the road vehicle traffic drives in the country/territoy of the place…
    Also the icon for the “Directions” button shows a “turn off left” mirrored icon now for places in drives-on-the-left countries as an additional attention-to-detail.

    Furigana Names in Japanese

    Since some time (around when we re-designed the place information “bubbles”) we show the native name for place under the name translated in the user's locale (when they are different).
    As there exists an established OpenStreetMap tag for phonetic names in Japanese (using Hiragana), name:ja-Hira akin to Furigana ( https://en.wikipedia.org/wiki/Furigana ) used to aid with pronounciation of place names. I had been thinking that it might be a good idea to show this when available as the dimmed supplimental text in the cases where the displayed name and native names are identical, and the Hiragana name is available. E.g. when the user's locale is Japanese and looking at Japanese names.  For other locales in these cases the displayed name would typically be the Romaji name with the Japanese full (Kanji) name displayed under it as the native name.
    So, I took the opportunity to discuss this with my college Daniel Markstedt, who speaks fluent Japanese and has lived many years in Japan. As he like the idea, and demo of it, I decided to go ahead with this!
    hiragana-name.png
    Showing a place in Japanese with supplemental Hiragana name

    Configurable Measurement Systems

    Since like the start of time, Maps has  shown distances in feet and miles when using a United States locale (or more precisely when measurements use such a locale, LC_MEASUREMENT when speaking about the environment variables). For other locales using standard metric measurements.
    Despite this we have several times recieved bug reports about Maps not  using the correct units. The issue here is that many users tend to prefer to have their computers speaking American English.
    So, I finally caved in and added an option to override the system default.
    hamburger-preferences.png
    Hamburger menu

    measurement-system-menu.png
    Hamburger menu showing measurement unit selection

    Station Symbols

    One feature I had been wanted to implement since we moved to vector tiles and integrated the customized highway shields from OpenStreeMap Americana is showing localized symbols for e.g. metro stations. Such as the classic “roundel” symbol used in London, and the ”T“ in Stockholm.
    After adding the network:wikidata tag to the pre-generated vector tiles this has been possible to implement. We choose to rely on the Wikidata tag instead of the network name/abbreviations as this is more stable and names could risk getting collitions with unrelated networks having the same (short-) name.
    hamburg-u-bahn.png
    U-Bahn station in Hamburg

    copenhagen-metro.png
    Metro stations in Copenhagen

    boston-t.png
    Subway stations in Boston

    berlin-s-bahn.png
    S-Bahn station in Berlin

    This requires the stations being tagged consitently to work out. I did some mass tagging of metro stations in Stockholm, Oslo, and Copenhagen. Other than that I mainly choose places where's at least partial coverage already.
    If you'd like to contribute and update a network with the network Wikidata tag, I prepared to quick steps to do such an edit with the JOSM OpenStreetMap desktop editor.
    Download a set of objects to update using an Overpass query, as an example, selecting the stations of Washing DC metro

    [out:xml][timeout:90][bbox:{{bbox}}];

    (

    nwr["network"="Washington Metro"]["railway"="station"];

    );

    (._;>;);

    out meta;

    josm-download-overpass-query.png
    JOSM Overpass download query editor

    Select the region to download from

    josm-select-region.png
    Select region in JOSM

    Select to only show the datalayer (not showing the background map) to make it easier to see the raw data.

    josm-show-layers.png
    Toggle data layers in JOSM

    Select the nodes.

    josm-select-nodes.png
    Show raw datapoints in JSOM

    Edit the field in the tag edit panel to update the value for all selected objects

    josm-edit-network-wikidata-tag.png
    Showing tags for selected objects

    Note that this sample assumed the relevant station node where already tagged with network names (the network tag). Other queries to limit selection might be needed.

    Also it could also be a good idea to reach out to local OSM communities before making bulk edits like this (e.g. if there is no such tagging at all in specific region) to make sure it would be aliged with expectations and such.

    Then it will also potentially take a while before it gets include in out monthly vector tile  update.

    When this has been done, given a suitable icon is available as e.g. public domain or commons in WikimediaCommons, it could be bundled in data/icons/stations and a definition added in the data mapping in src/mapStyle/stations.js.

    And More…

    One feature that has been long-wanted is the ability to dowload maps for offline usage. Lately precisely this is something James Westman has been working on.

    It's still an early draft, so we'll see when it is ready, but it already look pretty promising.

    hamburger-preferences.png
    Showing the new Preferences option



    download-dialog.png
    Preference dialog with dowloads

    download-select-area.png
    Selecting region to download

    download-rename.png
    Entering a name for a downloaded region

    download-areas.png
    Dialog showing dowloaded areas

    And that's it for now!

    • wifi_tethering open_in_new

      This post is public

      ml4711.blogspot.com /2025/06/midsommer-maps.html

    • chevron_right

      Michael Meeks: 2025-06-18 Wednesday

      news.movim.eu / PlanetGnome • 18 June

    • Up too early, out for a run with J. Sync with Dave. Plugged away at calls, admin, partner call, sales call, catch up with Philippe and Italo.
    • Birthday presents at lunch - new (identical) trousers, and a variable DC power supply for some electronics.
    • Published the next strip around the excitement of setting up your own non-profit structure:
    • wifi_tethering open_in_new

      This post is public

      meeksfamily.uk /~michael/blog/2025-06-18.html

    • chevron_right

      Jamie Gravendeel: UI-First Search With List Models

      news.movim.eu / PlanetGnome • 18 June • 7 minutes

    When managing large amounts of data, manual widget creation finds its limits. Not only because managing both data and UI separately is tedious, but also because performance will be a real concern.

    Luckily, there’s two solutions for this in GTK:

    1. Gtk.ListView using a factory: more performant since it reuses widgets when the list gets long
    2. Gtk.ListBox ‘s bind_model() : less performant, but can use boxed list styling

    This blog post provides an example of a Gtk.ListView containing my pets, which is sorted, can be searched, and is primarily made in Blueprint.

    The app starts with a plain window:

    from gi.repository import Adw, Gtk
    
    
    @Gtk.Template.from_resource("/app/example/Pets/window.ui")
    class Window(Adw.ApplicationWindow):
        """The main window."""
    
        __gtype_name__ = "Window"
    
    using Gtk 4.0;
    using Adw 1;
    
    template $Window: Adw.ApplicationWindow {
      title: _("Pets");
      default-width: 450;
      default-height: 450;
    
      content: Adw.ToolbarView {
        [top]
        Adw.HeaderBar {}
      }
    }
    

    Data Object

    The Gtk.ListView needs a data object to work with, which in this example is a pet with a name and species.

    This requires a GObject.Object called Pet with those properties, and a GObject.GEnum called Species :

    from gi.repository import Adw, GObject, Gtk
    
    
    class Species(GObject.GEnum):
        """The species of an animal."""
    
        NONE = 0
        CAT = 1
        DOG = 2
    
    […]
    
    class Pet(GObject.Object):
        """Data for a pet."""
    
        __gtype_name__ = "Pet"
    
        name = GObject.Property(type=str)
        species = GObject.Property(type=Species, default=Species.NONE)
    

    List View

    Now that there’s a data object to work with, the app needs a Gtk.ListView with a factory and model.

    To start with, there’s a Gtk.ListView wrapped in a Gtk.ScrolledWindow to make it scrollable, using the .navigation-sidebar style class for padding:

    content: Adw.ToolbarView {
      […]
    
      content: ScrolledWindow {
        child: ListView {
          styles [
            "navigation-sidebar",
          ]
        };
      };
    };
    

    Factory

    The factory builds a Gtk.ListItem for each object in the model, and utilizes bindings to show the data in the Gtk.ListItem :

    content: ListView {
      […]
    
      factory: BuilderListItemFactory {
        template ListItem {
          child: Label {
            halign: start;
            label: bind template.item as <$Pet>.name;
          };
        }
      };
    };

    Model

    Models can be modified through nesting. The data itself can be in any Gio.ListModel , in this case a Gio.ListStore works well.

    The Gtk.ListView expects a Gtk.SelectionModel because that’s how it manages its selection, so the Gio.ListStore is wrapped in a Gtk.NoSelection :

    using Gtk 4.0;
    using Adw 1;
    using Gio 2.0;
    
    […]
    
    content: ListView {
      […]
    
      model: NoSelection {
        model: Gio.ListStore {
          item-type: typeof<$Pet>;
    
          $Pet {
            name: "Herman";
            species: cat;
          }
    
          $Pet {
            name: "Saartje";
            species: dog;
          }
    
          $Pet {
            name: "Sofie";
            species: dog;
          }
    
          $Pet {
            name: "Rex";
            species: dog;
          }
    
          $Pet {
            name: "Lady";
            species: dog;
          }
    
          $Pet {
            name: "Lieke";
            species: dog;
          }
    
          $Pet {
            name: "Grumpy";
            species: cat;
          }
        };
      };
    };
    

    Sorting

    To easily parse the list, the pets should be sorted by both name and species.

    To implement this, the Gio.ListStore has to be wrapped in a Gtk.SortListModel which has a Gtk.MultiSorter with two sorters, a Gtk.NumericSorter and a Gtk.StringSorter .

    Both of these need an expression: the property that needs to be compared.

    The Gtk.NumericSorter expects an integer, not a Species , so the app needs a helper method to convert it:

    class Window(Adw.ApplicationWindow):
        […]
    
        @Gtk.Template.Callback()
        def _species_to_int(self, _obj: Any, species: Species) -> int:
            return int(species)
    
    model: NoSelection {
      model: SortListModel {
        sorter: MultiSorter {
          NumericSorter {
            expression: expr $_species_to_int(item as <$Pet>.species) as <int>;
          }
    
          StringSorter {
            expression: expr item as <$Pet>.name;
          }
        };
    
        model: Gio.ListStore { […] };
      };
    };
    

    To learn more about closures, such as the one used in the Gtk.NumericSorter , consider reading my previous blog post .

    Search

    To look up pets even faster, the user should be able to search for them by both their name and species.

    Filtering

    First, the Gtk.ListView ‘s model needs the logic to filter the list by name or species.

    This can be done with a Gtk.FilterListModel which has a Gtk.AnyFilter with two Gtk.StringFilter s.

    One of the Gtk.StringFilter s expects a string, not a Species , so the app needs another helper method to convert it:

    class Window(Adw.ApplicationWindow):
        […]
    
        @Gtk.Template.Callback()
        def _species_to_string(self, _obj: Any, species: Species) -> str:
            return species.value_nick
    
    model: NoSelection {
      model: FilterListModel {
        filter: AnyFilter {
          StringFilter {
            expression: expr item as <$Pet>.name;
          }
    
          StringFilter {
            expression: expr $_species_to_string(item as <$Pet>.species) as <string>;
          }
        };
    
        model: SortListModel { […] };
      };
    };
    

    Entry

    To actually search with the filters, the app needs a Gtk.SearchBar with a Gtk.SearchEntry .

    The Gtk.SearchEntry ‘s text property needs to be bound to the Gtk.StringFilter s’ search properties to filter the list on demand.

    To be able to start searching by typing from anywhere in the window, the Gtk.SearchEntry ‘s key-capture-widget has to be set to the window, in this case the template itself:

    content: Adw.ToolbarView {
      […]
    
      [top]
      SearchBar {
        key-capture-widget: template;
    
        child: SearchEntry search_entry {
          hexpand: true;
          placeholder-text: _("Search pets");
        };
      }
    
      content: ScrolledWindow {
        child: ListView {
          […]
    
          model: NoSelection {
            model: FilterListModel {
              filter: AnyFilter {
                StringFilter {
                  search: bind search_entry.text;
                  […]
                }
    
                StringFilter {
                  search: bind search_entry.text;
                  […]
                }
              };
    
              model: SortListModel { […] };
            };
          };
        };
      };
    };
    

    Toggle Button

    The Gtk.SearchBar should also be toggleable with a Gtk.ToggleButton .

    To do so, the Gtk.SearchEntry ‘s search-mode-enabled property should be bidirectionally bound to the Gtk.ToggleButton ‘s active property:

    content: Adw.ToolbarView {
      [top]
      Adw.HeaderBar {
        [start]
        ToggleButton search_button {
          icon-name: "edit-find-symbolic";
          tooltip-text: _("Search");
        }
      }
    
      [top]
      SearchBar {
        search-mode-enabled: bind search_button.active bidirectional;
        […]
      }
    
      […]
    };
    

    The search_button should also be toggleable with a shortcut, which can be added with a Gtk.ShortcutController :

    [start]
    ToggleButton search_button {
      […]
    
      ShortcutController {
        scope: managed;
    
        Shortcut {
          trigger: "<Control>f";
          action: "activate";
        }
      }
    }
    

    Empty State

    Last but not least, the view should fall back to an Adw.StatusPage if there are no search results.

    This can be done with a closure for the visible-child-name property in an Adw.ViewStack or Gtk.Stack . I generally prefer an Adw.ViewStack due to its animation curve.

    The closure takes the amount of items in the Gtk.NoSelection as input, and returns the correct Adw.ViewStackPage name:

    class Window(Adw.ApplicationWindow):
        […]
    
        @Gtk.Template.Callback()
        def _get_visible_child_name(self, _obj: Any, items: int) -> str:
            return "content" if items else "empty"
    
    content: Adw.ToolbarView {
      […]
    
      content: Adw.ViewStack {
        visible-child-name: bind $_get_visible_child_name(selection_model.n-items) as <string>;
        enable-transitions: true;
    
        Adw.ViewStackPage {
          name: "content";
    
          child: ScrolledWindow {
            child: ListView {
              […]
    
              model: NoSelection selection_model { […] };
            };
          };
        }
    
        Adw.ViewStackPage {
          name: "empty";
    
          child: Adw.StatusPage {
            icon-name: "edit-find-symbolic";
            title: _("No Results Found");
            description: _("Try a different search");
          };
        }
      };
    };
    

    End Result

    from typing import Any
    
    from gi.repository import Adw, GObject, Gtk
    
    
    class Species(GObject.GEnum):
        """The species of an animal."""
    
        NONE = 0
        CAT = 1
        DOG = 2
    
    
    @Gtk.Template.from_resource("/org/example/Pets/window.ui")
    class Window(Adw.ApplicationWindow):
        """The main window."""
    
        __gtype_name__ = "Window"
    
        @Gtk.Template.Callback()
        def _get_visible_child_name(self, _obj: Any, items: int) -> str:
            return "content" if items else "empty"
    
        @Gtk.Template.Callback()
        def _species_to_string(self, _obj: Any, species: Species) -> str:
            return species.value_nick
    
        @Gtk.Template.Callback()
        def _species_to_int(self, _obj: Any, species: Species) -> int:
            return int(species)
    
    
    class Pet(GObject.Object):
        """Data about a pet."""
    
        __gtype_name__ = "Pet"
    
        name = GObject.Property(type=str)
        species = GObject.Property(type=Species, default=Species.NONE)
    
    using Gtk 4.0;
    using Adw 1;
    using Gio 2.0;
    
    template $Window: Adw.ApplicationWindow {
      title: _("Pets");
      default-width: 450;
      default-height: 450;
    
      content: Adw.ToolbarView {
        [top]
        Adw.HeaderBar {
          [start]
          ToggleButton search_button {
            icon-name: "edit-find-symbolic";
            tooltip-text: _("Search");
    
            ShortcutController {
              scope: managed;
    
              Shortcut {
                trigger: "f";
                action: "activate";
              }
            }
          }
        }
    
        [top]
        SearchBar {
          key-capture-widget: template;
          search-mode-enabled: bind search_button.active bidirectional;
    
          child: SearchEntry search_entry {
            hexpand: true;
            placeholder-text: _("Search pets");
          };
        }
    
        content: Adw.ViewStack {
          visible-child-name: bind $_get_visible_child_name(selection_model.n-items) as ;
          enable-transitions: true;
    
          Adw.ViewStackPage {
            name: "content";
    
            child: ScrolledWindow {
              child: ListView {
                styles [
                  "navigation-sidebar",
                ]
    
                factory: BuilderListItemFactory {
                  template ListItem {
                    child: Label {
                      halign: start;
                      label: bind template.item as <$Pet>.name;
                    };
                  }
                };
    
                model: NoSelection selection_model {
                  model: FilterListModel {
                    filter: AnyFilter {
                      StringFilter {
                        expression: expr item as <$Pet>.name;
                        search: bind search_entry.text;
                      }
    
                      StringFilter {
                        expression: expr $_species_to_string(item as <$Pet>.species) as <string>;
                        search: bind search_entry.text;
                      }
                    };
    
                    model: SortListModel {
                      sorter: MultiSorter {
                        NumericSorter {
                          expression: expr $_species_to_int(item as <$Pet>.species) as <int>;
                        }
    
                        StringSorter {
                          expression: expr item as <$Pet>.name;
                        }
                      };
    
                      model: Gio.ListStore {
                        item-type: typeof<$Pet>;
    
                        $Pet {
                          name: "Herman";
                          species: cat;
                        }
    
                        $Pet {
                          name: "Saartje";
                          species: dog;
                        }
    
                        $Pet {
                          name: "Sofie";
                          species: dog;
                        }
    
                        $Pet {
                          name: "Rex";
                          species: dog;
                        }
    
                        $Pet {
                          name: "Lady";
                          species: dog;
                        }
    
                        $Pet {
                          name: "Lieke";
                          species: dog;
                        }
    
                        $Pet {
                          name: "Grumpy";
                          species: cat;
                        }
                      };
                    };
                  };
                };
              };
            };
          }
    
          Adw.ViewStackPage {
            name: "empty";
    
            child: Adw.StatusPage {
              icon-name: "edit-find-symbolic";
              title: _("No Results Found");
              description: _("Try a different search");
            };
          }
        };
      };
    }
    

    List models are pretty complicated, but I hope that this example provides a good idea of what’s possible from Blueprint, and is a good stepping stone to learn more.

    Thanks for reading!

    PS: a shout out to Markus for guessing what I’d write about next ;)

    • wifi_tethering open_in_new

      This post is public

      blogs.gnome.org /monster/ui-first-search-with-list-models/

    • chevron_right

      Matthew Garrett: Locally hosting an internet-connected server

      news.movim.eu / PlanetGnome • 17 June • 4 minutes

    I'm lucky enough to have a weird niche ISP available to me, so I'm paying $35 a month for around 600MBit symmetric data. Unfortunately they don't offer static IP addresses to residential customers, and nor do they allow multiple IP addresses per connection, and I'm the sort of person who'd like to run a bunch of stuff myself, so I've been looking for ways to manage this.

    What I've ended up doing is renting a cheap VPS from a vendor that lets me add multiple IP addresses for minimal extra cost. The precise nature of the VPS isn't relevant - you just want a machine (it doesn't need much CPU, RAM, or storage) that has multiple world routeable IPv4 addresses associated with it and has no port blocks on incoming traffic. Ideally it's geographically local and peers with your ISP in order to reduce additional latency, but that's a nice to have rather than a requirement.

    By setting that up you now have multiple real-world IP addresses that people can get to. How do we get them to the machine in your house you want to be accessible? First we need a connection between that machine and your VPS, and the easiest approach here is Wireguard . We only need a point-to-point link, nothing routable, and none of the IP addresses involved need to have anything to do with any of the rest of your network. So, on your local machine you want something like:

    [Interface]
    PrivateKey = privkeyhere
    ListenPort = 51820
    Address = localaddr/32

    [Peer]
    Endpoint = VPS:51820
    PublicKey = pubkeyhere
    AllowedIPs = VPS/0


    And on your VPS, something like:

    [Interface]
    Address = vpswgaddr/32
    SaveConfig = true
    ListenPort = 51820
    PrivateKey = privkeyhere

    [Peer]
    PublicKey = pubkeyhere
    AllowedIPs = localaddr/32


    The addresses here are (other than the VPS address) arbitrary - but they do need to be consistent, otherwise Wireguard is going to be unhappy and your packets will not have a fun time. Bring that interface up with wg-quick and make sure the devices can ping each other. Hurrah! That's the easy bit.

    Now you want packets from the outside world to get to your internal machine. Let's say the external IP address you're going to use for that machine is 321.985.520.309 and the wireguard address of your local system is 867.420.696.005 . On the VPS, you're going to want to do:

    iptables -t nat -A PREROUTING -p tcp -d 321.985.520.309 -j DNAT --to-destination 867.420.696.005

    Now, all incoming packets for 321.985.520.309 will be rewritten to head towards 867.420.696.005 instead (make sure you've set net.ipv4.ip_forward to 1 via sysctl !). Victory! Or is it? Well, no.

    What we're doing here is rewriting the destination address of the packets so instead of heading to an address associated with the VPS, they're now going to head to your internal system over the Wireguard link. Which is then going to ignore them, because the AllowedIPs statement in the config only allows packets coming from your VPS, and these packets still have their original source IP. We could rewrite the source IP to match the VPS IP, but then you'd have no idea where any of these packets were coming from, and that sucks. Let's do something better. On the local machine, in the peer, let's update AllowedIps to 0.0.0.0/0 to permit packets form any source to appear over our Wireguard link. But if we bring the interface up now, it'll try to route all traffic over the Wireguard link, which isn't what we want. So we'll add table = off to the interface stanza of the config to disable that, and now we can bring the interface up without breaking everything but still allowing packets to reach us. However, we do still need to tell the kernel how to reach the remote VPN endpoint, which we can do with ip route add vpswgaddr dev wg0 . Add this to the interface stanza as:

    PostUp = ip route add vpswgaddr dev wg0
    PreDown = ip route del vpswgaddr dev wg0


    That's half the battle. The problem is that they're going to show up there with the source address still set to the original source IP, and your internal system is (because Linux) going to notice it has the ability to just send replies to the outside world via your ISP rather than via Wireguard and nothing is going to work. Thanks, Linux. Thinux.

    But there's a way to solve this - policy routing. Linux allows you to have multiple separate routing tables, and define policy that controls which routing table will be used for a given packet. First, let's define a new table reference. On the local machine, edit /etc/iproute2/rt_tables and add a new entry that's something like:

    1 wireguard


    where "1" is just a standin for a number not otherwise used there. Now edit your wireguard config and replace table=off with table=wireguard - Wireguard will now update the wireguard routing table rather than the global one. Now all we need to do is to tell the kernel to push packets into the appropriate routing table - we can do that with ip rule add from localaddr lookup wireguard , which tells the kernel to take any packet coming from our Wireguard address and push it via the Wireguard routing table. Add that to your Wireguard interface config as:

    PostUp = ip rule add from localaddr lookup wireguard
    PreDown = ip rule del from localaddr lookup wireguard

    and now your local system is effectively on the internet.

    You can do this for multiple systems - just configure additional Wireguard interfaces on the VPS and make sure they're all listening on different ports. If your local IP changes then your local machines will end up reconnecting to the VPS, but to the outside world their accessible IP address will remain the same. It's like having a real IP without the pain of convincing your ISP to give it to you.

    comment count unavailable comments
    • chevron_right

      Jamie Gravendeel: Data Driven UI With Closures

      news.movim.eu / PlanetGnome • 16 June • 4 minutes

    It’s highly recommended to read my previous blog post first to understand some of the topics discussed here.

    UI can be hard to keep track of when changed imperatively, preferably it just follows the code’s state. Closures provide an intuitive way to do so by having data as input, and the desired value as output. They couple data with UI, but decouple the specific piece of UI that’s changed, making closures very modular. The example in this post uses Python and Blueprint.

    Technicalities

    First, it’s good to be familiar with the technical details behind closures. To quote from Blueprint’s documentation:

    Expressions are only reevaluated when their inputs change. Because Blueprint doesn’t manage a closure’s application code, it can’t tell what changes might affect the result. Therefore, closures must be pure , or deterministic. They may only calculate the result based on their immediate inputs, not properties of their inputs or outside variables.

    To elaborate, expressions know when their inputs have changed due to the inputs being GObject properties, which emit the “notify” signal when modified.

    Another thing to note is where casting is necessary. To again quote Blueprint’s documentation:

    Blueprint doesn’t know the closure’s return type, so closure expressions must be cast to the correct return type using a cast expression .

    Just like Blueprint doesn’t know about the return type, it also doesn’t know the type of ambiguous properties. To provide an example:

    Button simple_button {
      label: _("Click");
    }
    
    Button complex_button {
      child: Adw.ButtonContent {
        label: _("Click");
      };
    }

    Getting the label of simple_button in a lookup does not require a cast, since label is a known property of Gtk.Button with a known type:

    simple_button.label

    While getting the label of complex_button does require a cast, since child is of type Gtk.Widget , which does not have the label property:

    complex_button.child as <Adw.ButtonContent>.label

    Example

    To set the stage, there’s a window with a Gtk.Stack which has two Gtk.StackPage s, one for the content and one for the loading view:

    from gi.repository import Adw, Gtk
    
    
    @Gtk.Template.from_resource("/org/example/App/window.ui")
    class Window(Adw.ApplicationWindow):
        """The main window."""
    
        __gtype_name__ = "Window"
    using Gtk 4.0;
    using Adw 1;
    
    template $Window: Adw.ApplicationWindow {
      title: _("Demo");
    
      content: Adw.ToolbarView {
        [top]
        Adw.HeaderBar {}
    
        content: Stack {
          StackPage {
            name: "content";
    
            child: Label {
              label: _("Meow World!");
            };
          }
    
          StackPage {
            name: "loading";
    
            child: Adw.Spinner {};
          }
        };
      };
    }

    Switching Views Conventionally

    One way to manage the views would be to rely on signals to communicate when another view should be shown:

    from typing import Any
    
    from gi.repository import Adw, GObject, Gtk
    
    
    @Gtk.Template.from_resource("/org/example/App/window.ui")
    class Window(Adw.ApplicationWindow):
        """The main window."""
    
        __gtype_name__ = "Window"
    
        stack: Gtk.Stack = Gtk.Template.Child()
    
        loading_finished = GObject.Signal()
    
        @Gtk.Template.Callback()
        def _show_content(self, *_args: Any) -> None:
            self.stack.set_visible_child_name("content")

    A reference to the stack has been added, as well as a signal to communicate when loading has finished, and a callback to run when that signal is emitted.

    using Gtk 4.0;
    using Adw 1;
    
    template $Window: Adw.ApplicationWindow {
      title: _("Demo");
      loading-finished => $_show_content();
    
      content: Adw.ToolbarView {
        [top]
        Adw.HeaderBar {}
    
        content: Stack stack {
          StackPage {
            name: "content";
    
            child: Label {
              label: _("Meow World!");
            };
          }
    
          StackPage {
            name: "loading";
    
            child: Adw.Spinner {};
          }
        };
      };
    }

    A signal handler has been added, as well as a name for the Gtk.Stack .

    Only a couple of changes had to be made to switch the view when loading has finished, but all of them are sub-optimal:

    1. A reference in the code to the stack would be nice to avoid
    2. Imperatively changing the view makes following state harder
    3. This approach doesn’t scale well when the data can be reloaded, it would require another signal to be added

    Switching Views With a Closure

    To use a closure, the class needs data as input and a method to return the desired value:

    from typing import Any
    
    from gi.repository import Adw, GObject, Gtk
    
    
    @Gtk.Template.from_resource("/org/example/App/window.ui")
    class Window(Adw.ApplicationWindow):
        """The main window."""
    
        __gtype_name__ = "Window"
    
        loading = GObject.Property(type=bool, default=True)
    
        @Gtk.Template.Callback()
        def _get_visible_child_name(self, _obj: Any, loading: bool) -> str:
            return "loading" if loading else "content"

    The signal has been replaced with the loading property, and the template callback has been replaced by a method that returns a view name depending on the value of that property. _obj here is the template class, which is unused.

    using Gtk 4.0;
    using Adw 1;
    
    template $Window: Adw.ApplicationWindow {
      title: _("Demo");
    
      content: Adw.ToolbarView {
        [top]
        Adw.HeaderBar {}
    
        content: Stack {
          visible-child-name: bind $_get_visible_child_name(template.loading) as <string>;
    
          StackPage {
            name: "content";
    
            child: Label {
              label: _("Meow World!");
            };
          }
    
          StackPage {
            name: "loading";
    
            child: Adw.Spinner {};
          }
        };
      };
    }

    In Blueprint, the signal handler has been removed, as well as the unnecessary name for the Gtk.Stack . The visible-child-name property is now bound to a closure, which takes in the loading property referenced with template.loading .

    This fixed the issues mentioned before:

    1. No reference in code is required
    2. State is bound to a single property
    3. If the data reloads, the view will also adapt

    Closing Thoughts

    Views are just one UI element that can be managed with closures, but there’s plenty of other elements that should adapt to data, think of icons, tooltips, visibility, etc. Whenever you’re writing a widget with moving parts and data, think about how the two can be linked, your future self will thank you!

    • wifi_tethering open_in_new

      This post is public

      blogs.gnome.org /monster/data-driven-ui-with-closures/

    • chevron_right

      Jussi Pakkanen: A custom C++ standard library part 4: using it for real

      news.movim.eu / PlanetGnome • 16 June • 2 minutes

    Writing your own standard library is all fun and games until someone (which is to say yourself) asks the important question: could this be actually used for real? Theories and opinions can be thrown about the issue pretty much forever, but the only way to actually know for sure is to do it.

    Thus I converted CapyPDF , which is a fairly compact 15k LoC codebase from the C++ standard library to Pystd , which is about 4k lines. All functionality is still the same, which is to say that the test suite passes, there are most likely new bugs that the tests do not catch. For those wanting to replicate the results themselves, clone the CapyPDF repo, switch to the pystdport branch and start building. Meson will automatically download and set up Pystd as a subproject. The code is fairly bleeding edge and only works on Linux with GCC 15.1.

    Build times

    One of the original reasons for starting Pystd was being annoyed at STL compile times. Let's see if we succeeded in improving on them. Build times when using only one core in debug look like this.

    When optimizations are enabled the results look like this:

    In both cases the Pystd version compiles in about a quarter of the time.

    Binary size

    C++ gets a lot of valid criticism for creating bloated code. How much of that is due to the language as opposed to the library.

    That's quite unexpected. The debug info for STL types seems to take an extra 20 megabytes. But how about the executable code itself?

    STL is still 200 kB bigger. Based on observations most of this seems to come from stdlibc++'s implementation of variant . Note that if you try this yourself the Pystd version is probably 100 kB bigger, because by default the build setup links against libsubc++ , which adds 100+ kB to binary sizes whereas linking against the main C++ runtime library does not.

    Performance

    Ok, fine, so we can implement basic code to build faster and take less space. Fine. But what about performance? That is the main thing that matters after all, right? CapyPDF ships with a simple benchmark program. Let's look at its memory usage first.

    Apologies for the Y-axis does not starting at zero. I tried my best to make it happen, but LibreOffice Calc said no. In any case the outcome itself is as expected. Pystd has not seen any performance optimization work so it requiring 10% more memory is tolerable. But what about the actual runtime itself?

    This is unexpected to say the least. A reasonable result would have been to be only 2x slower than the standard library, but the code ended up being almost 25% faster. This is even stranger considering that Pystd's containers do bounds checks on all accesses, the UTF-8 parsing code sometimes validates its input twice, the hashing algorithm is a simple multiply-and-xor and so on. Pystd should be slower, and yet, in this case at least, it is not.

    I have no explanation for this.

    • wifi_tethering open_in_new

      This post is public

      nibblestew.blogspot.com /2025/06/a-custom-c-standard-library-part-4.html

    • chevron_right

      Sam Thursfield: Status update, 15/06/2025

      news.movim.eu / PlanetGnome • 15 June • 7 minutes

    This month I created a personal data map where I tried to list all my important digital identities.

    (It’s actually now a spreadsheet, which I’ll show you later. I didn’t want to start the blog post with something as dry as a screenshot of a spreadsheet.)

    Anyway, I made my personal data map for several reasons.

    The first reason was to stay safe from cybercrime . In a world of increasing global unfairness and inequality, of course crime and scams are increasing too. Schools don’t teach how digital tech actually works, so it’s a great time to be a cyber criminal. Imagine being a house burglar in a town where nobody knows how doors work.

    Lucky for me, I’m a professional door guy. So I don’t worry too much beyond having a really really good email password (it has numbers and letters). But its useful to double check if I have my credit card details on a site where the password is still “sam2003”.

    The second reason is to help me migrate to services based in Europe . Democracy over here is what it is, there are good days and bad days, but unlike the USA we have at least more options than a repressive death cult and a fundraising business. (Shout to @angusm@mastodon.social for that one). You can’t completely own your digital identity and your data, but you can at least try to keep it close to home.

    The third reason was to see who has the power to influence my online behaviour .

    This was an insight from reading the book Technofuedalism . I’ve always been uneasy about websites tracking everything I do. Most of us are, to the point that we have made myths like “your phone microphone is always listening so Instagram can target adverts”. (As McSweeney’s Internet Tendency confirms, it’s not! It’s just tracking everything you type, every app you use, every website you visit, and everywhere you go in the physical world ).

    I used to struggle to explain why all that tracking feels bad bad. Technofuedalism frames a concept of cloud capital , saying this is now more powerful than other kinds of capital because cloud capitalists can do something Henry Ford, Walt Disney and The Monopoly Guy can only dream of: mine their data stockpile to produce precisely targeted recommendations, search bubbles and adverts which can influence your behaviour before you’ve even noticed .

    This might sound paranoid when you first hear it, but consider how social media platforms reward you for expressing anger and outrage. Remember the first time you saw a post on Twitter from a stranger that you disagreed with? And your witty takedown attracted likes and praise? This stuff can be habit-forming.

    In the 20th century, ad agencies changed people’s buying patterns and political views using billboards, TV channel and newspapers. But all that is like a primitive blunderbuss compared to recommendation algorithms, feedback loops and targeted ads on social media and video apps.

    I lived through the days when web search for “Who won the last election” would just return you 10 pages that included the word “election”. (If you’re nostalgic for those days… you’ll be happy to know that GNOME’s desktop search engine still works like that today! 🙂 I can spot when apps trying to ‘nudge’ me with dark patterns. But kids aren’t born with that skill, and they aren’t necessarily going to understand the nature of Tech Billionaire power unless we help them to see it. We need a framework to think critically and discuss the power that Meta, Amazon and Microsoft have over everyone’s lives. Schools don’t teach how digital tech actually works, but maybe a “personal data map” can be a useful teaching tool?

    By the way, here’s what my cobbled-together “Personal data map” looks like, taking into account security, what data is stored and who controls it. ( With some fake data… I don’t want this blog post to be a “How to steal my identity” guide. )

    Name Risks Sensitivity rating Ethical rating Location Controlle r First factor Second factor Credentials cached? Data stored
    Bank account Financial loss 10 2 Europe Bank Fingerprint None On phone Money, transactions
    Instagram Identity theft 5 -10 USA Meta Password Email On phone Posts, likes, replies, friends, views, time spent, locations, searches.
    Google Mail ( sam@gmail.com ) Reset passwords 9 -5 USA Google Password None Yes – cookies Conversations, secrets
    Github Impersonation 3 3 USA Microsoft Password OTP Yes – cookies Credit card, projects, searches.

    How is it going migrating off USA based cloud services?

    “The internet was always a project of US power”, says Paris Marx , a keynote at PublicSpaces conference , which I never heard of before.

    Closing my Amazon account took an unnecessary amount of steps, and it was sad to say goodbye to the list of 12 different address I called home at various times since 2006, but I don’t miss it; I’ve been avoiding Amazon for years anyway. When I need English-language books, I get them from an Irish online bookstore named Kenny’s. (Ireland, cleverly, did not leave the EU so they can still ship books to Spain without incurring import taxes).

    Dropbox took a while because I had years of important stuff in there. I actually don’t think they’re too bad of a company, and it was certainly quick to delete my account. (And my data… right? You guys did delete all my data?).

    I was using Dropbox to sync notes with the Joplin notes app, and switched to the paid Joplin Cloud option , which seems a nice way to support a useful open source project.

    I still needed a way to store sensitive data, and realized I have access to Protondrive. I can’t recommend that as a service because the parent company Proton AG don’t seem so serious about Linux support, but I got it to work thanks to some heroes who added a protondrive backend to rclone .

    Instead of using Google cloud services to share photos, and to avoid anything so primitive as an actual cable, I learned that KDE Connect can transfer files from my Android phone over my laptop really neatly. KDE Connect is really good . On the desktop I use GSConnect which integrates with GNOME Shell really well. I think I’ve not been so impressed by a volunteer-driven open source project in years. Thanks to everyone who worked on these great apps!

    I also migrated my VPS from a US-based host Tornado VPS to one in Europe. Tornado VPS (formally prgmr.com) are a great company, but storing data in the USA doesn’t seem like the way forwards.

    That’s about it so far. Feels a bit better.

    What’s next?

    I’m not sure whats next!

    I can’t leave Github and Gitlab.com, but my days of “Write some interesting new code and push it straight to Github” are long gone. I didn’t sign up to train somebody else’s LLM for free, and neither should you. (I’m still interested in sharing interesting code with nice people, of course, but let’s not make it so easy for Corporate America to take our stuff without credit or compensation. Bring back the “ sneakernet “!)

    Leaving Meta platforms and dropping YouTube doesn’t feel directly useful. It’s like individually renouncing debit cards, or air travel: a lot of inconvenience for you, but the business owners don’t even notice. The important thing is to use the alternatives more . Hence why I still write a blog in 2025 and mostly read RSS feeds and the Fediverse. Gigs where I live are mostly only promoted on Instagram, but I’m sure that’s temporary.

    In the first quarter of 2025, rich people put more money into AI startups than everything else put together (see: Pivot to AI ). Investors love a good bubble, but there’s also an element of power here.

    If programmers only know how to write code using Copilot, then Microsoft have the power to decide what code we can and can’t write. (This currently this seems limited to not using the word ‘gender’ . But I can imagine a future where it catches you reverse-engineering proprietary software, or jailbreaking locked-down devices, or trying write a new Bittorrent client).

    If everyone gets their facts from ChatGPT, then OpenAI have the power to tweak everyone’s facts, an ability that is currently limited only to presidents of major world superpowers. If we let ourselves avoid critical thinking and rely on ChatGPT to generate answers to hard questions instead, which teachers say is very much exactly what’s happening in schools now … then what?

    • chevron_right

      Toluwaleke Ogundipe: Hello GNOME and GSoC!

      news.movim.eu / PlanetGnome • 14 June • 1 minute

    I am delighted to announce that I am contributing to GNOME Crosswords as part of the Google Summer of Code 2025 program. My project primarily aims to add printing support to Crosswords, with some additional stretch goals. I am being mentored by Jonathan Blandford , Federico Mena Quintero , and Tanmay Patil .

    The Days Ahead

    During my internship, I will be refactoring the puzzle rendering code to support existing and printable use cases, adding clues to rendered puzzles, and integrating a print dialog into the game and editor with crossword-specific options. Additionally, I should implement an ipuz2pdf utility to render puzzles in the IPUZ format to PDF documents.

    Beyond the internship, I am glad to be a member of the GNOME community and look forward to so much more. In the coming weeks, I will be sharing updates about my GSoC project and other contributions to GNOME. If you are interested in my journey with GNOME and/or how I got into GSoC, I implore you to watch out for a much longer post coming soon.

    Appreciation

    Many thanks to Hans Petter Jansson , Federico Mena Quintero and Jonathan Blandford , who have all played major roles in my journey with GNOME and GSoC. 🙏 ❤

    • wifi_tethering open_in_new

      This post is public

      blogs.gnome.org /anonymoux47/2025/06/14/hello-gnome-and-gsoc/

    • chevron_right

      Steven Deobald: 2025-06-14 Foundation Report

      news.movim.eu / PlanetGnome • 14 June • 4 minutes

    These weeks are going by fast and I’m still releasing these reports after the TWIG goes out. Weaker humans than I might be tempted to automate — but don’t worry! These will always be artisanal, hand-crafted, single-origin, uncut, and whole bean. Felix encouraged me to add these to following week’s TWIG, at least, so I’ll start doing that.

    ## Opaque Stuff

    • a few policy decisions are in-flight with the Board — productive conversations happening on all fronts, and it feels really good to see them moving forward

    ## Elections

    Voting closes in 5 days (June 19th). If you haven’t voted yet, get your votes in!

    ## GUADEC

    Planning for GUADEC is chugging along. Sponsored visas, flights, and hotels are getting sorted out.

    If you have a BoF or workshop proposal, get it in before tomorrow !

    ## Operations

    Our yearly CPA review is finalized. Tax filings and 990 prep are in flight.

    ## Infrastructure

    You may have seen our infrastructure announcement on social media earlier this week. This closes a long chapter of transitioning to AWS for GNOME’s essential services. A number of people have asked me if our setup is now highly AWS-specific. It isn’t. The vast majority of GNOME’s infrastructure runs on vanilla Linux and OpenShift. AWS helps our infrastructure engineers scale our services. They’re also generously donating the cloud infrastructure to the Foundation to support the GNOME project.

    ## Fundraising

    Over the weekend, I booted up a couple of volunteer developers to help with a sneaky little project we kicked off last week. As Julian, Pablo, Adrian, and Tobias have told me: No Promises… so I’m not making any. You’ll see it when you see it. 🙂 Hopefully in a few days. This has been the biggest focus of the Foundation over the past week-and-a-half.

    Many thanks to the other folks who’ve been helping with this little initiative. The Foundation could really use some financial help soon, and this project will be the base we build everything on top of.

    ## Meeting People

    Speaking of fundraising, I met Loren Crary of the Python Foundation! She is extremely cool and we found out that we both somehow descended on the term “gentle nerds”, each thinking we coined it ourselves. I first used this term in my 2015 Rootconf keynote . She’s been using it for ages, too. But I didn’t originally ask for her help with terminology. I went to her to sanity-check my approach to fundraising and — hooray! — she tells me I’m not crazy. Semi-related: she asked me if there are many books on GNOME and I had to admit I’ve never read one myself. A quick search shows me Mastering GNOME: A Beginner’s Guide and The Linux GNOME Desktop For Dummies . Have you ever read a book on GNOME? Or written one?

    I met Jorge Castro (of CNCF and Bazzite fame), a friend of Matt Hartley. We talked October GNOME, Wayland, dconf, KDE, Kubernetes, Fedora, and the fact that the Linux desktop is the true UI to cloud-native …everything. He also wants to be co-conspirators and I’m all about it. It had never really occurred to me that the ubiquity of dconf means GNOME is actually highly configurable, since I tend to eat the default GNOME experience (mostly), but it’s a good point. I told him a little story that the first Linux desktop experience that outstripped both Windows and MacOS for me was on a company-built RHEL machine back in 2010. Linux has been better than commercial operating systems for 15 years and the gap keeps widening. The Year of The Linux Desktop was a decade ago… just take the W.

    I had a long chat with Tobias and, among other things, we discussed the possibility of internal conversation spaces for Foundation Members and the possibility of a project General Assembly. Both nice ideas.

    I met Alejandro and Ousama from Slimbook. It was really cool to hear what their approach to the market is, how they ensure Linux and GNOME run perfectly on their hardware, and where their devices go. (They sell to NASA!) We talked about improving upstream communications and ways for the Foundation to facilitate that. We’re both hoping to get more Slimbooks in the hands of more developers.

    We had our normal Board meeting. Karen gave me some sage advice on fundraising campaigns and grants programs.

    ## One-Month Feedback Session

    I had my one-month feedback session with Rob and Allan, who are President and Vice-President at the moment, respectively. (And thus, my bosses.)

    Some key take-aways are that they’d like me to increase my focus on the finances and try to make my community outreach a little more sustainable by being less verbose. Probably two sides of the same coin, there. 🙂 I’ve already shifted my focus toward finances as of two weeks ago… which may mean you’ve seen less of me in Matrix and other community spaces. I’m still around! I just have my nose in a spreadsheet or something.

    They said some nice stuff, too, but nobody gets better by focusing on the stuff they’re already doing right.

    • wifi_tethering open_in_new

      This post is public

      blogs.gnome.org /steven/2025/06/14/2025-06-14-foundation-report/