logo

badwolf

Minimalist and privacy-oriented WebKitGTK+ browser
commit: 273d6cb15efc711f12d318e564b99f6589684139
parent: 5a86c8d7f38140f7eb736c0d4665de19889aa908
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu, 28 Mar 2019 20:37:38 +0100

Merge branch 'develop'

Diffstat:

MMakefile23+++++++++++++++++------
Mbadwolf.c2++
Mconfig.h10++++++++++
3 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,17 +1,28 @@ -LIBS = $(shell pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0) -PREFIX ?= /usr/local +.POSIX: -badwolf: badwolf.c config.h - $(CC) $(CFLAGS) $(LIBS) -o $@ $< +PREFIX = /usr/local + +DEPS = gtk+-3.0 webkit2gtk-4.0 +OBJS = badwolf + +CC = cc -std=c99 +CFLAGS = -g -Wall -Wextra +CDEPS = `pkg-config --cflags $(DEPS)` +LIBS = `pkg-config --libs $(DEPS)` + +all: $(OBJS) + +.c: + $(CC) $(CFLAGS) $(CDEPS) $(LDFLAGS) $(LIBS) -o $@ $< install: badwolf mkdir -p $(DESTDIR)$(PREFIX)/bin cp -p badwolf $(DESTDIR)$(PREFIX)/bin/badwolf clean: - rm badwolf + rm $(OBJS) format: *.c *.h - clang-format -style=file -assume-filename=~/.clang-format -i *.c *.h + clang-format -style=file -assume-filename=.clang-format -i *.c *.h .PHONY: clean install diff --git a/badwolf.c b/badwolf.c @@ -471,6 +471,8 @@ int main(int argc, char *argv[]) window->notebook = gtk_notebook_new(); window->new_tab = gtk_button_new_from_icon_name("tab-new-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_window_set_default_size( + GTK_WINDOW(window->main_window), BADWOLF_DEFAULT_WIDTH, BADWOLF_DEFAULT_HEIGHT); gtk_window_set_role(GTK_WINDOW(window->main_window), "browser"); gtk_widget_set_tooltip_text(window->new_tab, "Open new tab"); diff --git a/config.h b/config.h @@ -26,3 +26,13 @@ // BADWOLF_TOOLBAR_PADDING: Amount of padding between toolbar elements #define BADWOLF_TOOLBAR_PADDING 0 + +/* + * BADWOLF_DEFAULT_WIDTH / BADWOLF_DEFAULT_HEIGHT: + * Used to define the default width/height of the window, + * useful for floating Window Managers, probably useless in tiling ones + * + * See https://developer.gnome.org/gtk3/stable/GtkWindow.html#gtk-window-set-default-size + */ +#define BADWOLF_DEFAULT_WIDTH 800 +#define BADWOLF_DEFAULT_HEIGHT 600