add back support for transparency

Closes #191
This commit is contained in:
Daniel Micay 2014-10-27 12:25:58 -04:00
parent 05f3bbf626
commit 7612e90369
1 changed files with 13 additions and 0 deletions

View File

@ -1371,6 +1371,16 @@ static char *get_user_shell_with_fallback() {
return g_strdup("/bin/sh"); return g_strdup("/bin/sh");
} }
static void on_alpha_screen_changed(GtkWindow *window, GdkScreen *old_screen, void *) {
GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(window));
GdkVisual *visual = gdk_screen_get_rgba_visual(screen);
if (!visual)
visual = gdk_screen_get_system_visual(screen);
gtk_widget_set_visual(GTK_WIDGET(window), visual);
}
int main(int argc, char **argv) { int main(int argc, char **argv) {
GError *error = nullptr; GError *error = nullptr;
const char *const term = "xterm-termite"; const char *const term = "xterm-termite";
@ -1498,6 +1508,9 @@ int main(int argc, char **argv) {
g_signal_connect(window, "focus-in-event", G_CALLBACK(focus_cb), nullptr); g_signal_connect(window, "focus-in-event", G_CALLBACK(focus_cb), nullptr);
g_signal_connect(window, "focus-out-event", G_CALLBACK(focus_cb), nullptr); g_signal_connect(window, "focus-out-event", G_CALLBACK(focus_cb), nullptr);
on_alpha_screen_changed(GTK_WINDOW(window), nullptr, nullptr);
g_signal_connect(window, "screen-changed", G_CALLBACK(on_alpha_screen_changed), nullptr);
if (info.config.fullscreen) { if (info.config.fullscreen) {
g_signal_connect(window, "window-state-event", G_CALLBACK(window_state_cb), &info); g_signal_connect(window, "window-state-event", G_CALLBACK(window_state_cb), &info);
} }