diff options
author | fenze <contact@fenze.dev> | 2022-11-15 10:06:11 +0100 |
---|---|---|
committer | fenze <contact@fenze.dev> | 2022-11-15 10:07:14 +0100 |
commit | 68ca1eb61abd8f3a14664e3c6d58a3419fe194f7 (patch) | |
tree | b564a6a819b72dce37065a9855d3c93162c83e2c | |
parent | 369d73c7d80b647289958e9f594b2ef3235a4b8d (diff) |
Remove unused dependency, fix searchbar flashing
-rwxr-xr-x | build.sh | 2 | ||||
-rw-r--r-- | config.h | 6 | ||||
-rw-r--r-- | rose.c | 13 |
3 files changed, 11 insertions, 10 deletions
@@ -1,6 +1,6 @@ CC=clang SRC=rose.c -DEPS=('webkit2gtk-4.0' 'libadwaita-1') +DEPS=('webkit2gtk-4.0') INCS=`pkg-config --cflags ${DEPS[@]}` LIBS=`pkg-config --libs ${DEPS[@]}` @@ -15,10 +15,12 @@ /* See more: https://webkitgtk.org/reference/webkit2gtk/stable/class.Settings.html */ #define WEBKIT \ "enable-back-forward-navigation-gestures", true, \ - "enable-developer-extras", true + "enable-developer-extras", true, \ + "enable-smooth-scrolling", false #define GTK \ - "gtk-application-prefer-dark-theme", true + "gtk-application-prefer-dark-theme", true, \ + "gtk-enable-animations", false #define HOME "https://duckduckgo.com" #define SEARCH "https://duckduckgo.com/?q=%s" @@ -10,10 +10,7 @@ * Author: fenze <contact@fenze.dev> */ -#include <X11/Xlib.h> -#include <X11/Xatom.h> #include <webkit2/webkit2.h> - #include "config.h" #define CACHE \ @@ -32,7 +29,6 @@ enum { _SEARCH, _FIND }; - static int entry_mode; static GtkWindow *window; static GtkHeaderBar *bar; @@ -125,7 +121,8 @@ void notebook_append(GtkNotebook *notebook, const char *uri) int n = gtk_notebook_append_page(notebook, GTK_WIDGET(view), NULL); gtk_notebook_set_tab_reorderable(notebook, GTK_WIDGET(view), true); gtk_widget_show_all(GTK_WIDGET(window)); - webkit_web_view_set_background_color (view, &rgba); + gtk_widget_hide(GTK_WIDGET(bar)); + webkit_web_view_set_background_color(view, rgba); load_uri(view, (uri) ? uri : HOME); gtk_notebook_set_current_page(notebook, n); } @@ -299,7 +296,8 @@ int keypress(void *self, GdkEvent *e, GtkNotebook *notebook) void search_activate(GtkEntry *self, GtkNotebook *notebook) { if (entry_mode == _SEARCH) - load_uri(notebook_get_webview(notebook), gtk_entry_buffer_get_text(search_buf)); + load_uri(notebook_get_webview(notebook), + gtk_entry_buffer_get_text(search_buf)); else if (entry_mode == _FIND) webkit_find_controller_search( webkit_web_view_get_find_controller( @@ -352,6 +350,8 @@ void setup(GtkNotebook *notebook, const char* uri) window_init(notebook); notebook_init(notebook, uri); + g_object_set(gtk_settings_get_default(), GTK, NULL); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(notebook)); gtk_widget_show_all(GTK_WIDGET(window)); gtk_widget_hide(GTK_WIDGET(bar)); @@ -361,7 +361,6 @@ int main(int argc, char **argv) { GtkNotebook *notebook; gtk_init(NULL, NULL); - g_object_set(gtk_settings_get_default(), GTK, NULL); setup(notebook, argc > 1 ? argv[1] : NULL); gtk_main(); } |