Skip to content

Instantly share code, notes, and snippets.

Last active December 24, 2022 22:54
What would you like to do?
Audacity slider popup dirty fix
// cc -shared `pkg-config --cflags gtk+-3.0` -fPIC -o hack.c
#include <dlfcn.h>
#include <stdio.h>
#include <gtk-3.0/gtk/gtk.h>
void *library_handle = NULL;
void (*gtk_window_resize_impl)(GtkWindow *win, gint w, gint h);
#define GTK_LIB "/usr/lib/x86_64-linux-gnu/"
void gtk_window_resize(GtkWindow *win, gint w, gint h) {
if (!library_handle) {
library_handle = dlopen(GTK_LIB, RTLD_LAZY);
gtk_window_resize_impl = dlsym(library_handle, "gtk_window_resize");
const gchar *win_title = gtk_window_get_title(win);
if (!h && !strlen(win_title)) {
gtk_window_set_resizable(win, TRUE);
h = 27; // magic height!
printf("test: %d %d\n", w, h);
gtk_window_resize_impl(win, w, h);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment