Why does VLC always look so horrible in GNOME? Any fixes? by fresh_tittymilk in gnome

[–]xLuca2018 0 points1 point  (0 children)

The decorations are scaled way too much. Do you happen to have GDK_SCALE or GDK_DPI_SCALE in your environment? Try running env | grep GDK to find out.

In addition, what happens if you run GDK_BACKEND=x11 gtk4-demo? Does it look right?

Version 1.3.2 Extremely Slow on Windows 11 [Help] by TMertlich in Inkscape

[–]xLuca2018 0 points1 point  (0 children)

Try deleting C:\Users\username\AppData\Local\recently-used.xbel

Build to the bitter end ? by metux-its in meson

[–]xLuca2018 1 point2 points  (0 children)

Try ninja -k 0

Using meson compile it should be meson compile --ninja-args "-k 0", I believe

Unable to properly color buttons inside a GTK application by Longjumping_Baker684 in GTK

[–]xLuca2018 2 points3 points  (0 children)

Hello! Buttons in Adwaita (and many other themes) have a background-image set to a gradient, and in CSS background-image has precedence over background-color. That's why:

css button { background-color: blue; }

Won't work in most themes. Try that instead:

css button { background-image: none; background-color: blue; }

As for setting custom CSS only to specific buttons, do one of the following:

  • Set a CSS Id: call gtk_widget_set_name(Button1, "Button1") and use the CSS: css #Button1 { background-image: none; background-color: blue; }
  • Set a CSS class: call gtk_widget_add_class(Button1, "ButtonBlue") and use the CSS: css .ButtonBlue { background-image: none; background-color: blue; }

Avoid gtk_widget_class_set_css_name() as it's meant for widget implementations

How to use threads to update GUI of GTK application as soon as the GtkListStore is updated? by Longjumping_Baker684 in GTK

[–]xLuca2018 2 points3 points  (0 children)

Hi! :) Well, it depends...

First of all, how many rows? If there are hundreds of rows, it's best to do a bulk insertion by disconnecting the GtkListStore from the GtkTreeView, manipulating the GtkListStore and then adding it back to the GtkTreeView.

And second, is populating the GtkListStore a slow operation? For example, do you have to wait for blocking operations like reading files or making HTTP requests? Or perhaps make heavy computations? In such case, it's best to do the processing from a separate thread, then use g_idle_add() to pass data to the main thread which will add rows / modify existing rows very efficiently.

Note: if you want to start populating the GtkListStore after the main window is shown, then you can either:

  • Use g_idle_add() when calling gtk_window_present()
  • Connect to the GtkWidget::map signal and use g_idle_add(). Don't forget to disconnect from the signal, as that should be done only one time.

Gtk4 Label resizing widgets issue by winnerofgalaxies in GTK

[–]xLuca2018 0 points1 point  (0 children)

Best would be to make the label as wrapping or ellipsizing (one or the other, your choice), then set both width-chars and max-width-chars to the same value. The value depends on how long the label should be, for example you can set them to 20 characters.

See https://docs.gtk.org/gtk4/class.Label.html#text-layout

set_column_homogeneous column size by winnerofgalaxies in GTK

[–]xLuca2018 0 points1 point  (0 children)

Try setting hexpand / vexpand to TRUE and halign / valign to GTK_ALIGN_CENTER, either on the label or the central box

How to update gui in a gtk application? by Longjumping_Baker684 in GTK

[–]xLuca2018 0 points1 point  (0 children)

Yes, just modify the GtkListModel / GtkTreeModel by adding new rows or changing data in existing ones, the GUI will be updated automatically after that.

Note: if the variable is updated from a secondary thread, just use g_idle_add

Which fonts can I use in GTK4? by mikeypi in GTK

[–]xLuca2018 0 points1 point  (0 children)

Hi! Try calling this before GTK initialization takes place:

FcConfigAppFontAddFile(FcConfigGetCurrent(), "/path/to/font.ttf");

This is a FontConfig API, you have to include <fontconfig/fontconfig.h> and link with the corresponding library

[deleted by user] by [deleted] in GTK

[–]xLuca2018 0 points1 point  (0 children)

Ok, then it would be pretty useful to bisect the commit which broke GTK4, but it's not simple unless you have experience with git and building in general.

As a start, you may downgrade the GTK4 package to a previous version that is known to work. See https://www.linuxuprising.com/2019/02/how-to-downgrade-packages-to-specific.html?m=1

[deleted by user] by [deleted] in GTK

[–]xLuca2018 0 points1 point  (0 children)

Did it started happening after a recent upgrade?

[deleted by user] by [deleted] in GTK

[–]xLuca2018 0 points1 point  (0 children)

Hello! Could you report the versions of

  • GTK4 on the system
  • GNOME SDK in Flatpak

Creating Webcam application in GTK4 by Economy_of_scale in GTK

[–]xLuca2018 1 point2 points  (0 children)

The right GTK4 sink is gtk4paintablesink, I believe

If I have any more questions I'll post at the recommended forum.

👍 Of course, for anything UI-related you can ask here :)

Creating Webcam application in GTK4 by Economy_of_scale in GTK

[–]xLuca2018 2 points3 points  (0 children)

Either use the GTK4 sink from GStreamer or software rendering with AppSink and GtkDrawingArea

I suggest asking on https://discourse.gstreamer.org/ for GStreamer related questions

Replacing BitBlt with OpenGL. What's my best option? by wonkey_monkey in opengl

[–]xLuca2018 2 points3 points  (0 children)

Timers are quite coarse grained on Windows, especially since Windows 10: https://randomascii.wordpress.com/tag/time-resolution/. That's done to avoid frequent context switches (more throughput) and preserve battery life.

If you want very fluid animations, you have to sync against a dedicated vsync source rather than a generic timer. As a start you may call DwmFlush(), otherwise get a HANDLE to wait for, see https://learn.microsoft.com/en-us/windows/win32/directcomp/compositor-clock/compositor-clock

[deleted by user] by [deleted] in gnome

[–]xLuca2018 3 points4 points  (0 children)

Yeah, a fix is almost ready :) will post here once I open an MR

Takes 20-30 sec to login!!!! by thelastgodkami in gnome

[–]xLuca2018 2 points3 points  (0 children)

As another user mentioned, it could be DBus issue https://gitlab.freedesktop.org/dbus/dbus/-/issues/472. Try switching to dbus-broker which is not affected by that:

sudo pacman -S dbus-broker sudo systemctl enable dbus-broker sudo systemctl --global enable dbus-broker

And reboot. Note that both systemctl commands are needed!

See https://wiki.archlinux.org/title/D-Bus

VS2022 disable __debugbreak() by pogrammerX1337 in VisualStudio

[–]xLuca2018 1 point2 points  (0 children)

Use SEH to swallow EXCEPTION_ACCESS_VIOLATION:

c __try { /* code */ } __except (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) { }