Skip to content

Instantly share code, notes, and snippets.

@Monsterovich
Last active December 24, 2022 22:54
Show Gist options
  • Save Monsterovich/01717a44f0c7155ecb6a9d1f1544e371 to your computer and use it in GitHub Desktop.
Save Monsterovich/01717a44f0c7155ecb6a9d1f1544e371 to your computer and use it in GitHub Desktop.
Audacity slider popup dirty fix
// cc -shared `pkg-config --cflags gtk+-3.0` -fPIC -o audacity-slider-hack.so 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/libgtk-3.so"
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