Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 17, 2025

This PR fixes multiple compilation errors in the Linux platform-specific implementation files under src/platform/linux/. The errors were preventing the library from building on Linux systems.

Issues Fixed

KeyboardMonitor (keyboard_monitor_linux.cpp)

  • Fixed constructor initialization list that referenced non-existent event_dispatcher_ member
  • Updated event dispatching to use inherited EmitSync() method instead of missing DispatchEvent()
  • Removed incorrect DispatchEvent() method implementation

Menu System (menu_linux.cpp)

  • Fixed parameter type mismatches (changed std::string to const std::string& to match header declarations)
  • Fixed destructor to properly handle unique_ptr members (removed manual delete calls)
  • Removed implementations of non-existent methods (SetTitle, GetTitle, CreateItem)
  • Added missing GetNativeItem() implementation for MenuItem
  • Updated Menu methods to use shared_ptr<MenuItem> parameters as expected by the interface

TrayIcon (tray_icon_linux.cpp)

  • Fixed TrayIcon::Impl to use shared_ptr<Menu> instead of attempting to copy non-copyable Menu objects
  • Removed implementations of deprecated callback setter methods that don't exist in the header
  • Fixed shared_ptr access in context menu methods

WindowManager (window_manager_linux.cpp)

  • Fixed implementation class name from WindowManagerImpl to Impl to match header forward declaration
  • Fixed member variable name from impl_ to pimpl_ to match header
  • Updated event dispatching to use inherited EmitSync() method

DisplayManager (display_manager_linux.cpp)

  • Added missing destructor implementation to resolve linking errors

Testing

All Linux platform-specific files now compile successfully without errors:

  • The nativeapi library builds cleanly on Linux
  • Platform-specific compilation errors are resolved
  • No functional changes were made - only interface compatibility fixes

The changes are minimal and surgical, focusing exclusively on fixing compilation issues while preserving all existing functionality.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: lijy91 <3889523+lijy91@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Linux compilation errors (only modify code under the sr/platform/linux directory) Fix Linux compilation errors in platform-specific code Sep 17, 2025
Copilot AI requested a review from lijy91 September 17, 2025 13:28
@lijy91 lijy91 marked this pull request as ready for review September 17, 2025 13:29
@lijy91 lijy91 merged commit 2b82084 into main Sep 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants