feat: screenshot app improvement, WIndow Server supports full-screen overlay, Disks app UI improvements
This commit is contained in:
@@ -82,6 +82,7 @@ namespace Montauk {
|
||||
static constexpr uint64_t SYS_WINSETSCALE = 65;
|
||||
static constexpr uint64_t SYS_WINGETSCALE = 66;
|
||||
static constexpr uint64_t SYS_WINSETCURSOR = 68;
|
||||
static constexpr uint64_t SYS_WINSETFLAGS = 126;
|
||||
|
||||
// Process management syscalls
|
||||
static constexpr uint64_t SYS_PROCLIST = 61;
|
||||
@@ -270,8 +271,11 @@ namespace Montauk {
|
||||
uint8_t dirty;
|
||||
uint8_t cursor; // 0=arrow, 1=resize_h, 2=resize_v
|
||||
uint8_t _pad2[2];
|
||||
uint32_t flags;
|
||||
};
|
||||
|
||||
static constexpr uint32_t WIN_FLAG_FULLSCREEN = 1u << 0;
|
||||
|
||||
struct WinCreateResult {
|
||||
int32_t id; // -1 on failure
|
||||
uint32_t _pad;
|
||||
|
||||
@@ -70,6 +70,11 @@ struct WsWindow {
|
||||
montauk::win_setcursor(id, cursor);
|
||||
}
|
||||
|
||||
void set_flags(uint32_t flags) const {
|
||||
if (id >= 0)
|
||||
montauk::win_setflags(id, flags);
|
||||
}
|
||||
|
||||
void destroy() {
|
||||
if (id >= 0)
|
||||
montauk::win_destroy(id);
|
||||
|
||||
@@ -67,6 +67,7 @@ struct Window {
|
||||
bool external; // true = shared-memory window from external process
|
||||
int ext_win_id; // window server ID (valid when external == true)
|
||||
uint8_t ext_cursor; // cursor style requested by external app (0=arrow, 1=resize_h, 2=resize_v)
|
||||
uint32_t ext_flags;
|
||||
|
||||
Rect titlebar_rect() const {
|
||||
return {frame.x, frame.y, frame.w, TITLEBAR_HEIGHT};
|
||||
|
||||
@@ -88,6 +88,7 @@ extern "C" {
|
||||
#define MTK_SYS_WINGETSCALE 66
|
||||
#define MTK_SYS_MEMSTATS 67
|
||||
#define MTK_SYS_WINSETCURSOR 68
|
||||
#define MTK_SYS_WINSETFLAGS 126
|
||||
#define MTK_SYS_FDELETE 77
|
||||
#define MTK_SYS_FMKDIR 78
|
||||
#define MTK_SYS_FRENAME 94
|
||||
@@ -133,6 +134,8 @@ extern "C" {
|
||||
#define MTK_EVENT_CLOSE 3
|
||||
#define MTK_EVENT_SCALE 4
|
||||
|
||||
#define MTK_WIN_FLAG_FULLSCREEN (1u << 0)
|
||||
|
||||
/* Audio control commands */
|
||||
#define MTK_AUDIO_SET_VOLUME 0
|
||||
#define MTK_AUDIO_GET_VOLUME 1
|
||||
@@ -189,6 +192,7 @@ typedef struct {
|
||||
uint8_t dirty;
|
||||
uint8_t cursor;
|
||||
uint8_t _pad2[2];
|
||||
uint32_t flags;
|
||||
} mtk_win_info;
|
||||
|
||||
typedef struct {
|
||||
@@ -599,6 +603,10 @@ static inline int mtk_win_setcursor(int id, int cursor) {
|
||||
return (int)_mtk_syscall2(MTK_SYS_WINSETCURSOR, (long)id, (long)cursor);
|
||||
}
|
||||
|
||||
static inline int mtk_win_setflags(int id, uint32_t flags) {
|
||||
return (int)_mtk_syscall2(MTK_SYS_WINSETFLAGS, (long)id, (long)flags);
|
||||
}
|
||||
|
||||
static inline int mtk_win_setscale(int scale) {
|
||||
return (int)_mtk_syscall1(MTK_SYS_WINSETSCALE, (long)scale);
|
||||
}
|
||||
|
||||
@@ -554,5 +554,8 @@ namespace montauk {
|
||||
inline int win_setcursor(int id, int cursor) {
|
||||
return (int)syscall2(Montauk::SYS_WINSETCURSOR, (uint64_t)id, (uint64_t)cursor);
|
||||
}
|
||||
inline int win_setflags(int id, uint32_t flags) {
|
||||
return (int)syscall2(Montauk::SYS_WINSETFLAGS, (uint64_t)id, (uint64_t)flags);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user