# GTK3.24 -\> GTK4.1 Theme migrating hints

**URL:** https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486
**Category:** Products
**Created:** [February 13, 2021, 8:21am UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486 "2021-02-13T08:21:29Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![blue-dxca93](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/blue-dxca93/32/76530_2.png) [@blue-dxca93](https://forum.opendesktop.org/u/blue-dxca93)
#### Post date: [February 13, 2021, 8:21am UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/1 "2021-02-13T08:21:29Z")

</div>

This list will grow in future:  
GTK3.24 button:hover GTK4.1 button:hover, button:checked:hover  
GTK3.24 button:active GTK4 .1 button:active,button:checked:active  
GTK3.24 .menuitem:hover GTK4 .1 modelbutton.flat:hover, modelbutton.flat:selected  
GTK3.24 menubar \> menuitem:hover GTK4.1 menubar \> item:selected  
GTK3.24 progressbar \> progress GTK4.1 progressbar \> trough \> progress  
GTK3.24 headerbar, toolbar, primary-toolbar GTK4.1 toolbar  
GTK3.24 .background .titlebar GTK4.1 titlebar

NOTE: ONLY SEEN FROM THE CSS DESIGN, NOT FROM INTERNAL GTK CODE  
And thats how far i did progress till now.

 ![Bildschirmfoto-aero](https://forum.opendesktop.org/uploads/default/original/3X/5/8/580fe350faae85c81dcfc5b2420518c1a86dc9e6.png) ![Bildschirmfoto-aero2](https://forum.opendesktop.org/uploads/default/original/3X/3/e/3e082f62650e0bac054e87e0b271cf765c4a94b3.png)

---

<div class="post-metadata">

### Author: ![blue-dxca93](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/blue-dxca93/32/76530_2.png) [@blue-dxca93](https://forum.opendesktop.org/u/blue-dxca93)
#### Post date: [February 14, 2021, 9:00am UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/2 "2021-02-14T09:00:01Z")

</div>

![aero-print](https://forum.opendesktop.org/uploads/default/original/3X/a/2/a20d5d51cf4d6352d183a66b1241ebbbb8ad6330.png) ![Bildschirmfoto_2021-02-14_03-59-28](https://forum.opendesktop.org/uploads/default/original/3X/1/2/127ac658f4dda88a5b14b7151307b6919f464546.png)

GTK3.24 combobox menu GTK4.1 combobox popover, dropdown popover  
GTK3.24 progressbar.horizontal trough GTK4.1 progressbar.horizontal \> trough  
GTK3.24 menuitem {padding: } GTK4.1 modelbutton {min-height:}

---

<div class="post-metadata">

### Author: ![blue-dxca93](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/blue-dxca93/32/76530_2.png) [@blue-dxca93](https://forum.opendesktop.org/u/blue-dxca93)
#### Post date: [February 15, 2021, 5:06pm UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/3 "2021-02-15T17:06:09Z")

</div>

GTK4.1  
button.close  
button.maximize  
button.minimize

On gtk3.24 these where titlebuttons.  
on gt 4.1 a background image is not transferred to another state like :insensitive.

---

<div class="post-metadata">

### Author: ![paulxfce](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/paulxfce/32/118137_2.png) [@paulxfce](https://forum.opendesktop.org/u/paulxfce)
#### Post date: [February 17, 2021, 7:38pm UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/4 "2021-02-17T19:38:48Z")

</div>

I’ve been busy trying to port one of my themes to GTK4 based on Adwaita. But it is hard to test it, when there is nothing to test it on.  
Originally I figured that  
windowcontrols button.close {  
would be the code for the title-buttons.  
Yet you use  
button.close{

Has this changed?  
And what do you mean with ‘a background image is not transferred to another state’?  
And can you use SVG’s as title-buttons on GTK 4?

---

<div class="post-metadata">

### Author: ![blue-dxca93](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/blue-dxca93/32/76530_2.png) [@blue-dxca93](https://forum.opendesktop.org/u/blue-dxca93)
#### Post date: [February 17, 2021, 8:08pm UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/5 "2021-02-17T20:08:56Z")

</div>

It works atm. Did get the name while using GTK\_DEBUG=interactive (formerly gtkparasite.)

For the state thing: am not english native speaker so lets try an simple example:

button {  
background-image: linear-gradient(to bottom, blue, green);  
&:hover{background-color:red}  
}

On GTK3 button:hover is blue on top and green on bottom.  
On GTK4 button appears red. Unless you define a bg image for button:hover.

---

<div class="post-metadata">

### Author: ![blue-dxca93](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/blue-dxca93/32/76530_2.png) [@blue-dxca93](https://forum.opendesktop.org/u/blue-dxca93)
#### Post date: [February 17, 2021, 8:20pm UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/6 "2021-02-17T20:20:07Z")

</div>

To answer the svg question:  
button.close{  
color:rgba(0,0,0,0);  
-gtk-icon-shadow:none;  
border-style:none:  
box-shadow:none;  
background-position:center center;}  
Then you might load the svg with bg\_image url string. But don’t know how this affects hidpi scaling.

Alternative would be using -gtk-icon-source.

---

<div class="post-metadata">

### Author: ![paulxfce](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/paulxfce/32/118137_2.png) [@paulxfce](https://forum.opendesktop.org/u/paulxfce)
#### Post date: [February 17, 2021, 8:38pm UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/7 "2021-02-17T20:38:59Z")

</div>

Well, in GTK 3 it is this:

headerbar button.titlebutton.close,  
.titlebar button.titlebutton.close {

background-image: -gtk-scaled(url(“theme-graphics/title-buttons/titlebutton-close.svg”), url(“theme-graphics/title-buttons/titlebutton-close@2.svg”));  
}

The second graph is for 200% scaling.

So, in GTK 4 it should be something like this?

button.close {

background-image: -gtk-scaled(url(“theme-graphics/title-buttons/titlebutton-close.svg”), url(“theme-graphics/title-buttons/titlebutton-close@2.svg”));  
}

Which is basically simpler then before with GTK 3 …

---

<div class="post-metadata">

### Author: ![blue-dxca93](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/blue-dxca93/32/76530_2.png) [@blue-dxca93](https://forum.opendesktop.org/u/blue-dxca93)
#### Post date: [February 17, 2021, 8:53pm UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/8 "2021-02-17T20:53:10Z")

</div>

Yeah, just remember to set the other values to none or transparent in gtk4.  
Also don’t forget :hover etc.

---

<div class="post-metadata">

### Author: ![paulxfce](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/paulxfce/32/118137_2.png) [@paulxfce](https://forum.opendesktop.org/u/paulxfce)
#### Post date: [February 18, 2021, 4:56am UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/9 "2021-02-18T04:56:19Z")

</div>

I understand.

Basically background- color and background-image are on the same level. While it used to be background-image that overtakes background-color.

Thanks

---

<div class="post-metadata">

### Author: ![blue-dxca93](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/blue-dxca93/32/76530_2.png) [@blue-dxca93](https://forum.opendesktop.org/u/blue-dxca93)
#### Post date: [February 18, 2021, 5:46am UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/10 "2021-02-18T05:46:57Z")

</div>

On the same level background image is still preferred over background-color.

@etiennegnome  
The window decoration is now included in gtk4 applications as csd. Its dofferent from gtk3. Some very new gtk3 apps had it too.

---

<div class="post-metadata">

### Author: ![paulxfce](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/paulxfce/32/118137_2.png) [@paulxfce](https://forum.opendesktop.org/u/paulxfce)
#### Post date: [February 18, 2021, 7:22am UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/11 "2021-02-18T07:22:05Z")

</div>

So, every new gtk4 app will have csd decoration. No more single title bars?

---

<div class="post-metadata">

### Author: ![blue-dxca93](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/blue-dxca93/32/76530_2.png) [@blue-dxca93](https://forum.opendesktop.org/u/blue-dxca93)
#### Post date: [February 18, 2021, 3:21pm UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/12 "2021-02-18T15:21:39Z")

</div>

It doesn’ t need or accept decoration from a window manager anymore. All gtk4 apps would use csd. In fact there wont be something like gtk4-nocsd. Cause its dropping old outdated concepts from x11.

---

<div class="post-metadata">

### Author: ![blue-dxca93](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/blue-dxca93/32/76530_2.png) [@blue-dxca93](https://forum.opendesktop.org/u/blue-dxca93)
#### Post date: [February 18, 2021, 3:23pm UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/13 "2021-02-18T15:23:44Z")

</div>

Default is nearly no borders and a transparent shadow for Windows in adwaita.

---

<div class="post-metadata">

### Author: ![paulxfce](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/paulxfce/32/118137_2.png) [@paulxfce](https://forum.opendesktop.org/u/paulxfce)
#### Post date: [February 18, 2021, 4:04pm UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/14 "2021-02-18T16:04:43Z")

</div>

> [@blue-dxca93](#):
>
> It doesn’ t need or accept decoration from a window manager anymore. All gtk4 apps would use csd. In fact there wont be something like gtk4-nocsd. Cause its dropping old outdated concepts

There will be a bunch of linux-diehards not happy about that 😉

---

<div class="post-metadata">

### Author: ![etiennegnome](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/etiennegnome/32/46565_2.png) [@etiennegnome](https://forum.opendesktop.org/u/etiennegnome)
#### Post date: [February 21, 2021, 3:41pm UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/15 "2021-02-21T15:41:56Z")

</div>

Ok, I understand

---

<div class="post-metadata">

### Author: ![etiennegnome](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/etiennegnome/32/46565_2.png) [@etiennegnome](https://forum.opendesktop.org/u/etiennegnome)
#### Post date: [February 21, 2021, 4:08pm UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/16 "2021-02-21T16:08:42Z")

</div>

I don’t understand what you are saying.  
Does this mean that GTK4 no longer handles (or at least differently) window decorations ?  
Does this mean that the Gnome team is returning to the principles of the old GTK2 ? so the management of decorations is left to Gnome-shell, for example?

---

<div class="post-metadata">

### Author: ![blue-dxca93](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/blue-dxca93/32/76530_2.png) [@blue-dxca93](https://forum.opendesktop.org/u/blue-dxca93)
#### Post date: [February 21, 2021, 6:41pm UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/17 "2021-02-21T18:41:28Z")

</div>

To put it simply in GTK4 the application draws the window decoration itself. If you use xfwm, sawfish icewm or kde/kwin, pekwm the application has every time the same window border and decoration cause the GTK4 application draws it on its own. A dark theme app would mostly have a dark window decoration and a light mode a light decoration while using the same theme.

---

<div class="post-metadata">

### Author: ![paulxfce](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/paulxfce/32/118137_2.png) [@paulxfce](https://forum.opendesktop.org/u/paulxfce)
#### Post date: [February 22, 2021, 12:59pm UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/18 "2021-02-22T12:59:31Z")

</div>

Basically, Etienne, everything on top will be a headerbar. No title bar.

---

<div class="post-metadata">

### Author: ![etiennegnome](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/etiennegnome/32/46565_2.png) [@etiennegnome](https://forum.opendesktop.org/u/etiennegnome)
#### Post date: [February 23, 2021, 5:10pm UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/19 "2021-02-23T17:10:23Z")

</div>

Ok, like in GTK3 …

---

<div class="post-metadata">

### Author: ![blue-dxca93](https://forum.opendesktop.org/user_avatar/forum.opendesktop.org/blue-dxca93/32/76530_2.png) [@blue-dxca93](https://forum.opendesktop.org/u/blue-dxca93)
#### Post date: [February 23, 2021, 5:27pm UTC](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486/20 "2021-02-23T17:27:36Z")

</div>

If you look at the actual newer gtk3 version yes maybe. But now these decorations are a have to. In gtk3 you could use client side decoration or disable it woth gtk3-nocsd. Gtk4 its gotten mandatory and every window has it. Even those with menubar below these bars

[Next page](https://forum.opendesktop.org/t/gtk3-24-gtk4-1-theme-migrating-hints/19486.md?page=2)
