commit
0d0f54195a
15
termite.cc
15
termite.cc
|
@ -88,7 +88,7 @@ struct hint_info {
|
||||||
struct config_info {
|
struct config_info {
|
||||||
hint_info hints;
|
hint_info hints;
|
||||||
char *browser;
|
char *browser;
|
||||||
gboolean dynamic_title, urgent_on_bell, clickable_url, opacity_set;
|
gboolean dynamic_title, urgent_on_bell, clickable_url, opacity_set, pseudo_transparency;
|
||||||
int tag;
|
int tag;
|
||||||
char *config_file;
|
char *config_file;
|
||||||
};
|
};
|
||||||
|
@ -105,7 +105,7 @@ struct draw_cb_info {
|
||||||
};
|
};
|
||||||
|
|
||||||
static void launch_browser(char *browser, char *url);
|
static void launch_browser(char *browser, char *url);
|
||||||
static void set_opacity(GtkWidget *window, VteTerminal *vte, double opacity);
|
static void set_opacity(GtkWidget *window, VteTerminal *vte, double opacity, gboolean pseudo);
|
||||||
static void window_title_cb(VteTerminal *vte, gboolean *dynamic_title);
|
static void window_title_cb(VteTerminal *vte, gboolean *dynamic_title);
|
||||||
static gboolean key_press_cb(VteTerminal *vte, GdkEventKey *event, keybind_info *info);
|
static gboolean key_press_cb(VteTerminal *vte, GdkEventKey *event, keybind_info *info);
|
||||||
static gboolean entry_key_press_cb(GtkEntry *entry, GdkEventKey *event, keybind_info *info);
|
static gboolean entry_key_press_cb(GtkEntry *entry, GdkEventKey *event, keybind_info *info);
|
||||||
|
@ -130,9 +130,9 @@ void launch_browser(char *browser, char *url) {
|
||||||
g_spawn_async(nullptr, browser_cmd, nullptr, G_SPAWN_SEARCH_PATH, nullptr, nullptr, nullptr, nullptr);
|
g_spawn_async(nullptr, browser_cmd, nullptr, G_SPAWN_SEARCH_PATH, nullptr, nullptr, nullptr, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_opacity(GtkWidget *window, VteTerminal *vte, double opacity) {
|
static void set_opacity(GtkWidget *window, VteTerminal *vte, double opacity, gboolean psuedo) {
|
||||||
vte_terminal_set_background_saturation(vte, opacity);
|
vte_terminal_set_background_saturation(vte, opacity);
|
||||||
vte_terminal_set_background_transparent(vte, false);
|
vte_terminal_set_background_transparent(vte, psuedo);
|
||||||
|
|
||||||
GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(window));
|
GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(window));
|
||||||
GdkVisual *visual;
|
GdkVisual *visual;
|
||||||
|
@ -1168,6 +1168,7 @@ static void set_config(GtkWindow *window, VteTerminal *vte, config_info *info,
|
||||||
info->dynamic_title = cfg_bool("dynamic_title", TRUE);
|
info->dynamic_title = cfg_bool("dynamic_title", TRUE);
|
||||||
info->urgent_on_bell = cfg_bool("urgent_on_bell", TRUE);
|
info->urgent_on_bell = cfg_bool("urgent_on_bell", TRUE);
|
||||||
info->clickable_url = cfg_bool("clickable_url", TRUE);
|
info->clickable_url = cfg_bool("clickable_url", TRUE);
|
||||||
|
info->pseudo_transparency = cfg_bool("pseudo_transparency", FALSE);
|
||||||
|
|
||||||
if (info->clickable_url) {
|
if (info->clickable_url) {
|
||||||
info->tag =
|
info->tag =
|
||||||
|
@ -1234,7 +1235,7 @@ static void set_config(GtkWindow *window, VteTerminal *vte, config_info *info,
|
||||||
|
|
||||||
if (auto opacity = get_config_double(config, "options", "transparency")) {
|
if (auto opacity = get_config_double(config, "options", "transparency")) {
|
||||||
if (!info->opacity_set) {
|
if (!info->opacity_set) {
|
||||||
set_opacity(GTK_WIDGET(window), vte, *opacity);
|
set_opacity(GTK_WIDGET(window), vte, *opacity, info->pseudo_transparency);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1337,7 +1338,7 @@ int main(int argc, char **argv) {
|
||||||
nullptr},
|
nullptr},
|
||||||
{vi_mode::insert, 0, 0, 0, 0},
|
{vi_mode::insert, 0, 0, 0, 0},
|
||||||
{{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, 0, 0},
|
{{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, 0, 0},
|
||||||
nullptr, FALSE, FALSE, FALSE, FALSE, -1, config_file}
|
nullptr, FALSE, FALSE, FALSE, FALSE, FALSE, -1, config_file}
|
||||||
};
|
};
|
||||||
|
|
||||||
load_config(GTK_WINDOW(window), vte, &info.config, geometry ? nullptr : &geometry);
|
load_config(GTK_WINDOW(window), vte, &info.config, geometry ? nullptr : &geometry);
|
||||||
|
@ -1401,7 +1402,7 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
if (trans > 0.0) {
|
if (trans > 0.0) {
|
||||||
info.config.opacity_set = true;
|
info.config.opacity_set = true;
|
||||||
set_opacity(GTK_WIDGET(window), vte, trans);
|
set_opacity(GTK_WIDGET(window), vte, trans, info.config.pseudo_transparency);
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_widget_grab_focus(vte_widget);
|
gtk_widget_grab_focus(vte_widget);
|
||||||
|
|
Loading…
Reference in New Issue