Skip to content

Commit

Permalink
Try to fix navbar overlap
Browse files Browse the repository at this point in the history
  • Loading branch information
suhan-paradkar committed Aug 26, 2021
1 parent e6c3898 commit 6b14843
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 23 deletions.
14 changes: 7 additions & 7 deletions app/src/main/jni/lorie/compositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ client_created_listener(*this) {}
int proc(int fd, uint32_t mask, void *data) {
LorieCompositor *b = static_cast<LorieCompositor*>(data);
if (b == nullptr) {LOGF("b == nullptr"); return 0;}

b->queue.run();
return 0;
};
Expand All @@ -49,15 +49,15 @@ void LorieCompositor::start() {
wl_event_loop_add_fd(wl_display_get_event_loop(display), queue.get_fd(), WL_EVENT_READABLE, &proc, this);

wl_display_add_client_created_listener(display, &client_created_listener);

wl_display_init_shm (display);
wl_resource_t::global_create<LorieCompositor_>(display, this);
wl_resource_t::global_create<LorieSeat>(display, this);
wl_resource_t::global_create<LorieOutput>(display, this);
wl_resource_t::global_create<LorieShell>(display, this);

backend_init();

wl_display_run(display);
}

Expand All @@ -66,10 +66,10 @@ struct wl_event_source* LorieCompositor::add_fd_listener(int fd, uint32_t mask,
struct wl_event_loop* loop = nullptr;
if (display != nullptr)
loop = wl_display_get_event_loop(display);

if (loop != nullptr)
return wl_event_loop_add_fd(loop, fd, mask, func, data);

return nullptr;
}

Expand Down Expand Up @@ -188,12 +188,12 @@ void LorieCompositor::real_keyboard_key_modifiers(uint8_t depressed, uint8_t lat
key_modifiers.latched == latched &&
key_modifiers.locked == locked &&
key_modifiers.group == group) return;

key_modifiers.depressed = depressed;
key_modifiers.latched = latched;
key_modifiers.locked = locked;
key_modifiers.group = group;

client->keyboard.send_modifiers (next_serial(), depressed, latched, locked, group);
}

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/jni/lorie/egl-helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void LorieEGLHelper::swap() {
2, // Request opengl ES2.0
EGL_NONE
};

ctx = eglCreateContext(dpy, cfg, NULL, ctxattribs);
if (ctx == EGL_NO_CONTEXT) {
LOGE("LorieEGLHelper::init : eglCreateContext failed: %s", eglGetErrorText(eglGetError()));
Expand All @@ -166,13 +166,13 @@ void LorieEGLHelper::uninit() {
return;
}
ctx = EGL_NO_CONTEXT;

if (eglDestroySurface(dpy, sfc) != EGL_TRUE) {
LOGE("LorieEGLHelper::uninit : eglDestroySurface failed: %s", eglGetErrorText(eglGetError()));
return;
}
sfc = EGL_NO_SURFACE;

if (eglTerminate(dpy) != EGL_TRUE) {
LOGE("LorieEGLHelper::uninit : eglTerminate failed: %s", eglGetErrorText(eglGetError()));
return;
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/jni/lorie/include/lorie-client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class LorieClient : public wl_listener {
operator struct wl_client*() { return client; }
private:
struct wl_client *client = NULL;

static void destroyed(struct wl_listener *listener, void *data);
};

Expand All @@ -37,7 +37,7 @@ class wl_client_created_listener_t: public wl_listener {
data_t user_data = nullptr;
static void created_callback(struct wl_listener* listener, void *data) {
if (listener == nullptr || data == nullptr) return;

new client_t(static_cast<struct wl_client*>(data),
(static_cast<wl_client_created_listener_t*>(listener))->user_data);
}
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/jni/lorie/include/lorie-compositor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class LorieCompositor {
// compositor features
void start();
struct wl_event_source* add_fd_listener(int fd, uint32_t mask, wl_event_loop_fd_func_t func, void *data);

void set_toplevel(LorieSurface *surface);
void set_cursor(LorieSurface *surface, uint32_t hotspot_x, uint32_t hotspot_y);

Expand Down Expand Up @@ -54,7 +54,7 @@ class LorieCompositor {
wrapper(keyboard_keymap_changed);
#undef wrapper


LorieRenderer renderer;
LorieSurface*& toplevel;
LorieSurface*& cursor;
Expand All @@ -69,26 +69,26 @@ class LorieCompositor {

//private:
struct wl_display *display = nullptr;


LorieMessageQueue queue;
private:
wl_client_created_listener_t<LorieClient, LorieCompositor&> client_created_listener;

struct LorieClient* get_toplevel_client();
uint32_t next_serial();

struct {
uint32_t depressed = 0, latched = 0, locked = 0, group = 0;
} key_modifiers;
};

class LorieClipboard {
public:
public:
LorieClipboard(LorieDataSource &data_source);
LorieDataSource &data_source;
int read_fd;

struct wl_array contents;
struct wl_array mime_types;
struct wl_listener selection_listener;
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/jni/lorie/include/lorie-message-queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class LorieMessageQueue {
public:
LorieMessageQueue();
void write(std::function<void()> func);

template<typename Ret, typename Class, typename ... Args>
void call(Ret Class::* __pm, Args&& ... args) {
write(std::bind(std::mem_fn(__pm), args...));
Expand All @@ -25,7 +25,7 @@ template<class Class, class T, class... Args>
struct LorieFuncWrapper {
using TFn = T (Class::*)(Args...);
LorieFuncWrapper(TFn fn, Class* cl, LorieMessageQueue& q): cl(cl), ptr(fn), q(q) {};

Class* cl;
TFn ptr;
LorieMessageQueue& q;
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/jni/lorie/message-queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#include <errno.h>
#include <sys/eventfd.h>

LorieMessageQueue::LorieMessageQueue() {
LorieMessageQueue::LorieMessageQueue() {
pthread_mutex_init(&write_mutex, nullptr);
pthread_mutex_init(&read_mutex, nullptr);

fd = eventfd(0, EFD_CLOEXEC);
if (fd == -1) {
LOGE("Failed to create socketpair for message queue: %s", strerror(errno));
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:fitsSystemWindows">true</item>
</style>
<style name="NoActionBar" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:fitsSystemWindows">true</item>
</style>

</resources>

0 comments on commit 6b14843

Please sign in to comment.