Skip to content

Commit

Permalink
move gtk_init; expose headers
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj committed Jul 8, 2024
1 parent 9e08cfb commit aefd6df
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ if(LINUX)
endif()

include_directories(pugixml/src)
include_directories(webview)

if(NOT "${WKWEBVIEW_PROTOCOL}" STREQUAL "")
add_definitions(-DWKWEBVIEW_PROTOCOL="${WKWEBVIEW_PROTOCOL}")
Expand Down
2 changes: 0 additions & 2 deletions preview/preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ int main(int argc, char *argv[]) {
#ifdef __APPLE__
@autoreleasepool {
NSApplication *application = [NSApplication sharedApplication];
#elif defined(__linux__)
gtk_init(&argc, &argv);
#endif
std::unique_ptr<candidate_window::CandidateWindow> candidateWindow =
std::make_unique<candidate_window::WebviewCandidateWindow>();
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ endif()

add_library(WebviewCandidateWindow ${SOURCES})

target_include_directories(WebviewCandidateWindow PRIVATE "${PROJECT_SOURCE_DIR}/include")
target_include_directories(WebviewCandidateWindow PUBLIC "${PROJECT_SOURCE_DIR}/include" "${PROJECT_SOURCE_DIR}/webview")

if(APPLE)
target_link_libraries(WebviewCandidateWindow "-framework WebKit" PkgConfig::NlohmannJson)
Expand Down
1 change: 1 addition & 0 deletions src/linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
namespace candidate_window {

void *WebviewCandidateWindow::create_window() {
gtk_init(nullptr, nullptr);
auto window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(window), 400, 300);
gtk_window_set_decorated(GTK_WINDOW(window), FALSE);
Expand Down

0 comments on commit aefd6df

Please sign in to comment.