Doubt about building a GTK 4 app

First of all, I don’t really know if i’m in the correct category of the forum, so please excuse if not.

All i want to now is, it’s normal to see my GTK 4 application bigger when I build it in Builder?

I’m using Ubuntu, and when I build the application, seems like this:


The cursor is just so much bigger than the ‘normal’ one; the window buttons and top bar are also bigger (and uglier). It’s normal?

Well, you have to specify what you mean with “bigger”.
Since we have no idea how your environment looks (desktop, other apps, etc.) we can’t tell what you would be expecting.

We also don’t know what your app consists of. Is it build with or without libadwaita, for example? Are you building it with Flatpak?

From my environment (Gnome on Fedora), the app looks as I would expect.

So, you need to provide more information so we can understand your question without making wild guesses.

Im going to use Text Editor as reference.


Also, the mouse pointer is (normally) so much smaller.
And yes, i’m using libadwaita, and since is just the “default” Builder application with a few changes (without changes I had the same issue), i’m going to supose that its builded with Flatpak.

I forgot. Here is the XML file.

<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <requires lib="gtk" version="4.0"/>
  <requires lib="Adw" version="1.0"/>
  <template class="ZenstudioWindow" parent="AdwApplicationWindow">
    <property name="title" translatable="no">Zen Studio</property>
    <property name="default-width">800</property>
    <property name="default-height">600</property>
    <property name="content">
      <object class="AdwToolbarView">
        <child type="top">
          <object class="AdwHeaderBar">
            <child type="end">
              <object class="GtkMenuButton">
                <property name="primary">True</property>
                <property name="icon-name">open-menu-symbolic</property>
                <property name="tooltip-text" translatable="yes">Main Menu</property>
                <property name="menu-model">primary_menu</property>
              </object>
            </child>
          </object>
        </child>
        <property name="content">
          <object class="GtkScrolledWindow">
            <property name="hexpand">true</property>
            <property name="vexpand">true</property>
            <property name="margin-top">5</property>
            <property name="margin-bottom">5</property>
            <property name="margin-start">5</property>
            <property name="margin-end">5</property>
            <property name="child">
              <object class="GtkTextView" id="txt_code">
                <property name="monospace">true</property>
              </object>
            </property>
          </object>
        </property>
      </object>
    </property>
  </template>
  <menu id="primary_menu">
    <section>
      <item>
        <attribute name="label" translatable="yes">_Preferences</attribute>
        <attribute name="action">app.preferences</attribute>
      </item>
      <item>
        <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
        <attribute name="action">win.show-help-overlay</attribute>
      </item>
      <item>
        <attribute name="label" translatable="yes">_About Zenstudio</attribute>
        <attribute name="action">app.about</attribute>
      </item>
    </section>
  </menu>
</interface>

Im using Python.

If you’re building against GTK’s main development branch (using the nightly GNOME SDK), and you’re using fractional scaling, then the cursor size is expected, and the result of a GNOME Shell issue that was fixed only recently, and will need to be backported to GNOME 47: Implement wp_viewport support for cursor surfaces (!3859) · Merge requests · GNOME / mutter · GitLab

Issue solved. I just exported the project as Flatpak, and the problem dissapeared. Anyway, thanks for the answers.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.