mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-11-11 02:06:38 +08:00
[fix] resolve cross-platform build warnings
This commit is contained in:
@@ -102,7 +102,11 @@ void Launch(const fs::path& executable, const std::vector<std::string>& argument
|
||||
}
|
||||
execv(executable.c_str(), argv.data());
|
||||
const int error = errno;
|
||||
(void)write(errors[1], &error, sizeof(error));
|
||||
// This small blocking pipe write is atomic. Retry signal interruptions so
|
||||
// the parent cannot mistake a failed exec for a successful launch.
|
||||
ssize_t written;
|
||||
do { written = write(errors[1], &error, sizeof(error)); }
|
||||
while (written < 0 && errno == EINTR);
|
||||
_exit(127);
|
||||
}
|
||||
close(errors[1]);
|
||||
|
||||
@@ -17,16 +17,16 @@ namespace crossdesk {
|
||||
class PlatformKeyboardCapturer final : public KeyboardCapturer {
|
||||
public:
|
||||
PlatformKeyboardCapturer();
|
||||
virtual ~PlatformKeyboardCapturer();
|
||||
~PlatformKeyboardCapturer() override;
|
||||
|
||||
public:
|
||||
virtual int Hook(OnKeyAction on_key_action, void* user_ptr);
|
||||
virtual int Unhook();
|
||||
int Hook(OnKeyAction on_key_action, void* user_ptr) override;
|
||||
int Unhook() override;
|
||||
bool SupportsTextInput() const override { return true; }
|
||||
int SendTextCommand(const std::string& text) override;
|
||||
virtual int SendKeyboardCommand(int key_code, bool is_down,
|
||||
uint32_t scan_code = 0,
|
||||
bool extended = false);
|
||||
int SendKeyboardCommand(int key_code, bool is_down,
|
||||
uint32_t scan_code = 0,
|
||||
bool extended = false) override;
|
||||
|
||||
private:
|
||||
CFMachPortRef event_tap_ = nullptr;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: DI JUNKUN
|
||||
* @Date: 2023-12-14
|
||||
* Copyright (c) 2023 by DI JUNKUN, All Rights Reserved.
|
||||
* Copyright (c) 2026 by DI JUNKUN, All Rights Reserved.
|
||||
*/
|
||||
|
||||
#ifndef _MOUSE_CONTROLLER_H_
|
||||
@@ -20,15 +20,15 @@ namespace crossdesk {
|
||||
class PlatformMouseController final : public MouseController {
|
||||
public:
|
||||
PlatformMouseController();
|
||||
virtual ~PlatformMouseController();
|
||||
~PlatformMouseController() override;
|
||||
|
||||
public:
|
||||
virtual int Init(std::vector<DisplayInfo> display_info_list);
|
||||
virtual int Destroy();
|
||||
virtual int SendMouseCommand(RemoteAction remote_action, int display_index);
|
||||
int Init(std::vector<DisplayInfo> display_info_list) override;
|
||||
int Destroy() override;
|
||||
int SendMouseCommand(RemoteAction remote_action, int display_index) override;
|
||||
unsigned ReleasePressedButtons(unsigned mask = 7) override;
|
||||
void UpdateDisplayInfoList(
|
||||
const std::vector<DisplayInfo>& display_info_list);
|
||||
const std::vector<DisplayInfo>& display_info_list) override;
|
||||
|
||||
private:
|
||||
struct ClickTracker {
|
||||
|
||||
Reference in New Issue
Block a user