feat: screenshot app improvement, WIndow Server supports full-screen overlay, Disks app UI improvements
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
#include "Device.hpp" // SYS_DEVLIST, SYS_DISKINFO
|
||||
#include "Input.hpp" // SYS_INPUT_WAIT
|
||||
#include "Storage.hpp" // SYS_PARTLIST, SYS_DISKREAD, SYS_DISKWRITE
|
||||
#include "Window.hpp" // SYS_WINCREATE, SYS_WINDESTROY, SYS_WINPRESENT, SYS_WINPOLL, SYS_WINENUM, SYS_WINMAP, SYS_WINSENDEVENT, SYS_WINRESIZE, SYS_WINSETSCALE, SYS_WINGETSCALE
|
||||
#include "Window.hpp" // SYS_WINCREATE, SYS_WINDESTROY, SYS_WINPRESENT, SYS_WINPOLL, SYS_WINENUM, SYS_WINMAP, SYS_WINSENDEVENT, SYS_WINRESIZE, SYS_WINSETCURSOR, SYS_WINSETFLAGS, SYS_WINSETSCALE, SYS_WINGETSCALE
|
||||
#include "Audio.hpp" // SYS_AUDIOOPEN, SYS_AUDIOCLOSE, SYS_AUDIOWRITE, SYS_AUDIOCTL
|
||||
#include "BluetoothSyscall.hpp" // SYS_BTSCAN, SYS_BTCONNECT, SYS_BTDISCONNECT, SYS_BTLIST, SYS_BTINFO
|
||||
#include "IpcSyscall.hpp" // SYS_DUPHANDLE, SYS_WAIT_HANDLE, SYS_STREAM_CREATE, SYS_STREAM_READ, SYS_STREAM_WRITE, SYS_MAILBOX_CREATE, SYS_MAILBOX_SEND, SYS_MAILBOX_RECV, SYS_WAITSET_CREATE, SYS_WAITSET_ADD, SYS_WAITSET_REMOVE, SYS_WAITSET_WAIT, SYS_PROC_OPEN, SYS_SURFACE_CREATE, SYS_SURFACE_MAP, SYS_SURFACE_RESIZE
|
||||
@@ -297,6 +297,8 @@ namespace Montauk {
|
||||
return (int64_t)Sys_WinGetScale();
|
||||
case SYS_WINSETCURSOR:
|
||||
return (int64_t)Sys_WinSetCursor((int)frame->arg1, (int)frame->arg2);
|
||||
case SYS_WINSETFLAGS:
|
||||
return (int64_t)Sys_WinSetFlags((int)frame->arg1, (uint32_t)frame->arg2);
|
||||
case SYS_MEMSTATS:
|
||||
if (!UserMemory::Writable<MemStats>(frame->arg1)) return -1;
|
||||
Sys_MemStats((MemStats*)frame->arg1);
|
||||
|
||||
@@ -129,6 +129,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.hpp */
|
||||
static constexpr uint64_t SYS_PROCLIST = 61;
|
||||
@@ -329,8 +330,11 @@ namespace Montauk {
|
||||
uint8_t dirty;
|
||||
uint8_t cursor; // 0=arrow, 1=resize_h, 2=resize_v
|
||||
uint8_t _pad[2];
|
||||
uint32_t flags;
|
||||
};
|
||||
|
||||
static constexpr uint32_t WIN_FLAG_FULLSCREEN = 1u << 0;
|
||||
|
||||
struct WinCreateResult {
|
||||
int32_t id; // -1 on failure
|
||||
uint32_t _pad;
|
||||
|
||||
@@ -159,6 +159,7 @@ namespace WinServer {
|
||||
slot.ownerVa = userVa;
|
||||
slot.dirty = false;
|
||||
slot.cursor = 0;
|
||||
slot.flags = 0;
|
||||
|
||||
int tlen = 0;
|
||||
while (title[tlen] && tlen < 63) {
|
||||
@@ -224,6 +225,7 @@ namespace WinServer {
|
||||
info.height = g_slots[i].height;
|
||||
info.dirty = g_slots[i].dirty ? 1 : 0;
|
||||
info.cursor = g_slots[i].cursor;
|
||||
info.flags = g_slots[i].flags;
|
||||
g_slots[i].dirty = false;
|
||||
count++;
|
||||
}
|
||||
@@ -336,6 +338,16 @@ namespace WinServer {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SetFlags(int windowId, int callerPid, uint32_t flags) {
|
||||
WsGuard guard;
|
||||
if (windowId < 0 || windowId >= MaxWindows) return -1;
|
||||
|
||||
WindowSlot& slot = g_slots[windowId];
|
||||
if (!slot.used || slot.ownerPid != callerPid) return -1;
|
||||
slot.flags = flags & Montauk::WIN_FLAG_FULLSCREEN;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SetScale(int scale) {
|
||||
WsGuard guard;
|
||||
if (scale < 0) scale = 0;
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace WinServer {
|
||||
uint64_t ownerVa; // mapped VA of liveSurface in owner
|
||||
bool dirty;
|
||||
uint8_t cursor; // 0=arrow, 1=resize_h, 2=resize_v
|
||||
uint32_t flags;
|
||||
};
|
||||
|
||||
int Create(int ownerPid, uint64_t ownerPml4, const char* title, int w, int h,
|
||||
@@ -39,6 +40,7 @@ namespace WinServer {
|
||||
uint64_t& heapNext, uint64_t& outVa);
|
||||
void CleanupProcess(int pid);
|
||||
int SetCursor(int windowId, int callerPid, int cursor);
|
||||
int SetFlags(int windowId, int callerPid, uint32_t flags);
|
||||
int SetScale(int scale);
|
||||
int GetScale();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Window.hpp
|
||||
* SYS_WINCREATE, SYS_WINDESTROY, SYS_WINPRESENT, SYS_WINPOLL,
|
||||
* SYS_WINENUM, SYS_WINMAP, SYS_WINSENDEVENT, SYS_WINRESIZE,
|
||||
* SYS_WINSETSCALE, SYS_WINGETSCALE syscalls
|
||||
* SYS_WINSETCURSOR, SYS_WINSETFLAGS, SYS_WINSETSCALE, SYS_WINGETSCALE syscalls
|
||||
* Copyright (c) 2026 Daniel Hammer
|
||||
*/
|
||||
|
||||
@@ -75,6 +75,10 @@ namespace Montauk {
|
||||
return WinServer::SetCursor(windowId, Sched::GetCurrentPid(), cursor);
|
||||
}
|
||||
|
||||
static int Sys_WinSetFlags(int windowId, uint32_t flags) {
|
||||
return WinServer::SetFlags(windowId, Sched::GetCurrentPid(), flags);
|
||||
}
|
||||
|
||||
static int Sys_WinSetScale(int scale) {
|
||||
return WinServer::SetScale(scale);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user