Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ file(GLOB CONFIG_UI_FILES CONFIGURE_DEPENDS config/*.swift)

add_library(Fcitx5Objs STATIC
fcitx.cpp
tunnel.cpp
config/config.cpp
controller.swift
${CONFIG_UI_FILES}
Expand Down
2 changes: 1 addition & 1 deletion src/controller.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class FcitxInputController: IMKInputController {
}

override func handle(_ event: NSEvent!, client sender: Any!) -> Bool {
guard let event = event, let _ = sender as? IMKTextInput else {
guard let event = event, sender as? IMKTextInput != nil else {
return false
}

Expand Down
3 changes: 3 additions & 0 deletions src/fcitx-public.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@ std::string getAddons() noexcept;
std::string getActions() noexcept;
void activateActionById(int id) noexcept;

// Tunnel variables
#include "tunnel.h"

#endif
5 changes: 5 additions & 0 deletions src/tunnel.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "tunnel.h"

bool f5m_is_linear_layout = false;
bool f5m_is_vertical_rl = false;
bool f5m_is_vertical_lr = false;
5 changes: 5 additions & 0 deletions src/tunnel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

extern bool f5m_is_linear_layout;
extern bool f5m_is_vertical_lr;
extern bool f5m_is_vertical_rl;
2 changes: 1 addition & 1 deletion webpanel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
add_library(webpanel STATIC webpanel.cpp)
add_library(webpanel STATIC webpanel.cpp tunnel.cpp)
target_link_libraries(webpanel Fcitx5::Core)
target_include_directories(webpanel PRIVATE "${PROJECT_SOURCE_DIR}/src")

Expand Down
4 changes: 4 additions & 0 deletions webpanel/tunnel.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Weak definitions for tunnel variables used in webpanel.
__attribute__((weak)) bool f5m_is_linear_layout = false;
__attribute__((weak)) bool f5m_is_vertical_rl = false;
__attribute__((weak)) bool f5m_is_vertical_lr = false;
6 changes: 6 additions & 0 deletions webpanel/webpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,14 @@ void WebPanel::update(UserInterfaceComponent component,
std::vector<candidate_window::Candidate> candidates;
int size = 0;
candidate_window::layout_t layout = config_.typography->layout.value();
f5m_is_linear_layout =
(layout == candidate_window::layout_t::horizontal);
candidate_window::writing_mode_t writingMode =
config_.typography->writingMode.value();
f5m_is_vertical_rl =
(writingMode == candidate_window::writing_mode_t::vertical_rl);
f5m_is_vertical_lr =
(writingMode == candidate_window::writing_mode_t::vertical_lr);
if (const auto &list = inputPanel.candidateList()) {
switch (list->layoutHint()) {
case CandidateLayoutHint::Vertical:
Expand Down
Loading