@@ -54,8 +54,8 @@ static void auto_connect(lv_libinput_capability capability, int max_num_devs, in
|
||||
*/
|
||||
|
||||
static void auto_connect(lv_libinput_capability capability, int max_num_devs, int *num_devs, char *devs[], lv_indev_t *indevs[]) {
|
||||
memset(devs, 0, max_num_devs * sizeof(char *));
|
||||
memset(indevs, 0, max_num_devs * sizeof(lv_indev_t *));
|
||||
lv_memset(devs, 0, max_num_devs * sizeof(char *));
|
||||
lv_memset(indevs, 0, max_num_devs * sizeof(lv_indev_t *));
|
||||
|
||||
*num_devs = lv_libinput_find_devs(capability, devs, max_num_devs, false);
|
||||
|
||||
|
@@ -238,7 +238,7 @@ int main(int argc, char *argv[]) {
|
||||
if (resize_terminals) {
|
||||
/* Clean up on termination */
|
||||
struct sigaction action;
|
||||
memset(&action, 0, sizeof(action));
|
||||
lv_memset(&action, 0, sizeof(action));
|
||||
action.sa_handler = sigaction_handler;
|
||||
sigaction(SIGINT, &action, NULL);
|
||||
sigaction(SIGTERM, &action, NULL);
|
||||
@@ -261,27 +261,23 @@ int main(int argc, char *argv[]) {
|
||||
int32_t hor_res_phys = lv_display_get_horizontal_resolution(disp);
|
||||
int32_t ver_res_phys = lv_display_get_vertical_resolution(disp);
|
||||
lv_display_set_physical_resolution(disp, hor_res_phys, ver_res_phys);
|
||||
// TODO: Sofware-rotation is currently broken in the framebuffer driver (https://gitlab.com/postmarketOS/buffybox/-/issues/26)
|
||||
lv_display_set_rotation(disp, cli_opts.rotation);
|
||||
switch (cli_opts.rotation) {
|
||||
case LV_DISPLAY_ROTATION_0:
|
||||
case LV_DISPLAY_ROTATION_180: {
|
||||
lv_coord_t denom = keyboard_height_denominator(hor_res_phys, ver_res_phys);
|
||||
lv_display_set_resolution(disp, hor_res_phys, ver_res_phys / denom);
|
||||
lv_display_set_offset(disp, 0, (denom - 1) * ver_res_phys / denom);
|
||||
// lv_display_set_rotation(disp, cli_opts.rotation);
|
||||
// switch (cli_opts.rotation) {
|
||||
// case LV_DISPLAY_ROTATION_0:
|
||||
// case LV_DISPLAY_ROTATION_180: {
|
||||
// lv_coord_t denom = keyboard_height_denominator(hor_res_phys, ver_res_phys);
|
||||
// lv_display_set_resolution(disp, hor_res_phys, ver_res_phys / denom);
|
||||
// lv_display_set_offset(disp, 0, (cli_opts.rotation == LV_DISPLAY_ROTATION_0) ? (denom - 1) * ver_res_phys / denom : 0);
|
||||
// break;
|
||||
// }
|
||||
// case LV_DISPLAY_ROTATION_90:
|
||||
// case LV_DISPLAY_ROTATION_270: {
|
||||
// lv_coord_t denom = keyboard_height_denominator(ver_res_phys, hor_res_phys);
|
||||
// lv_display_set_resolution(disp, hor_res_phys / denom, ver_res_phys);
|
||||
// lv_display_set_offset(disp, (cli_opts.rotation == LV_DISPLAY_ROTATION_90) ? (denom - 1) * hor_res_phys / denom : 0, 0);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
lv_display_set_offset(disp, 0, (cli_opts.rotation == LV_DISPLAY_ROTATION_0) ? (denom - 1) * ver_res_phys / denom : 0);
|
||||
break;
|
||||
}
|
||||
case LV_DISPLAY_ROTATION_90:
|
||||
case LV_DISPLAY_ROTATION_270: {
|
||||
lv_coord_t denom = keyboard_height_denominator(ver_res_phys, hor_res_phys);
|
||||
lv_display_set_resolution(disp, hor_res_phys / denom, ver_res_phys);
|
||||
lv_display_set_offset(disp, 0, (cli_opts.rotation == LV_DISPLAY_ROTATION_90) ? (denom - 1) * hor_res_phys / denom : 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Connect input devices */
|
||||
bb_indev_auto_connect();
|
||||
|
2
lvgl
2
lvgl
Submodule lvgl updated: 1ea51ad616...f37aebf332
@@ -6,6 +6,8 @@
|
||||
|
||||
#include "sq2lv.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
||||
/**
|
||||
* Static variables
|
||||
@@ -214,7 +216,7 @@ int *sq2lv_get_modifier_indexes(lv_obj_t *keyboard, int *num_modifiers) {
|
||||
}
|
||||
|
||||
#if SQ2LV_SCANCODES_ENABLED
|
||||
int *sq2lv_get_scancodes(lv_obj_t *keyboard, uint16_t btn_id, int *num_scancodes) {
|
||||
const int * const sq2lv_get_scancodes(lv_obj_t *keyboard, uint16_t btn_id, int *num_scancodes) {
|
||||
if (current_layout_id < 0 || current_layout_id >= sq2lv_num_layouts) {
|
||||
*num_scancodes = 0;
|
||||
return NULL;
|
||||
|
@@ -70,7 +70,7 @@ int *sq2lv_get_modifier_indexes(lv_obj_t *keyboard, int *num_modifiers);
|
||||
* @param num_scancodes pointer to an integer into which the number of scancodes will be written
|
||||
* @return pointer into an array of scancodes at the appropriate index
|
||||
*/
|
||||
int *sq2lv_get_scancodes(lv_obj_t *keyboard, uint16_t btn_id, int *num_scancodes);
|
||||
const int * const sq2lv_get_scancodes(lv_obj_t *keyboard, uint16_t btn_id, int *num_scancodes);
|
||||
#endif /* SQ2LV_SCANCODES_ENABLED */
|
||||
|
||||
#endif /* SQ2LV_H */
|
||||
|
Reference in New Issue
Block a user