Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add focus & resize window functions #164

Merged
merged 12 commits into from
Jul 14, 2023
Merged

Conversation

ekrenzin
Copy link
Contributor

@ekrenzin ekrenzin commented Jun 6, 2023

Title: PR: Add focusWindow and resizeWindow Functionality

Description

This pull request introduces new functionality to the window manager. With the modifications made in this PR, users can now focus on a specific window and resize it using its window handle. The implementation covers all supported platforms - Windows, macOS, and Linux.

Changes

  1. index.d.ts: Declared new exported functions focusWindow and resizeWindow.
  2. permissionCheck.js: Added focusWindow and resizeWindow to permission checks.
  3. src/linux/window_manager.cc: Implemented the functionality of focusWindow and resizeWindow for Linux using Xlib.
  4. src/macos/window_manager.mm: Implemented the functionality of focusWindow and resizeWindow for macOS using Objective-C++ and the Cocoa API.
  5. src/main.cc: Added the wrapper functions for focusWindow and resizeWindow, enabling them to be called from JavaScript.
  6. src/win32/window_manager.cc: Implemented the functionality of focusWindow and resizeWindow for Windows using Win32 API.
  7. src/window_manager.h: Added the function declarations for focusWindow and resizeWindow.

New Functions

  • focusWindow(handle: number): void;
    Focuses the window specified by the provided window handle. Brings the window to the foreground and gives it input focus.

  • resizeWindow(handle: number, width: number, height: number): void;
    Resizes the window specified by the provided window handle to the given width and height.

Testing

Please test these changes by trying to focus and resize the window using their respective new functions on all supported platforms. Verify that the functions return appropriate boolean values indicating the success of the operation.

Impact

These changes should not impact any existing functionality in the application. Instead, they provide the users with new capabilities of focusing and resizing windows from their application.

Open Issue

#18

@ekrenzin ekrenzin mentioned this pull request Jun 6, 2023
@ekrenzin ekrenzin requested a review from s1hofmann July 12, 2023 06:52
@s1hofmann s1hofmann merged commit 901f5aa into nut-tree:develop Jul 14, 2023
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