profile
viewpoint
Bartosz Sosnowski bzoz Janea Systems Poland

bzoz/native-hdr-histogram 1

node.js bindings for hdr histogram C implementation

bzoz/PowerToys 1

Windows system utilities to maximize productivity

JaneaSystems/glob-args 1

CLI helper for globing arguments

bzoz/autocannon 0

fast HTTP benchmarking tool written in Node.js

bzoz/cheerio 0

Fast, flexible, and lean implementation of core jQuery designed specifically for the server.

bzoz/commander.js 0

node.js command-line interfaces made easy

bzoz/csv-parser 0

Streaming csv parser inspired by binary-csv that aims to be faster than everyone else

bzoz/electron 0

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS

bzoz/generator 0

Rails-inspired generator system that provides scaffolding for your apps

issue commentmicrosoft/PowerToys

FancyZone version 0.14.1.0 renders Civilization VI non-responsive

I think yes. The excluded list is the only way to do this, since at leas one other game works and can be zoned without issues.

ized3d

comment created time in 2 days

issue closedmicrosoft/PowerToys

[DevDocs] Improve documentation for hwnd_cache

We need to improve the documentation for https://github.com/microsoft/PowerToys/blob/master/src/common/hwnd_data_cache.h and https://github.com/microsoft/PowerToys/blob/master/src/common/hwnd_data_cache.cpp

Also consider renaming some methods: get_window_and_path -> this function filters out the current window and if not filtered, it returns the ancestor window handle and path

get_window -> this function is identical to get_window_and_path but returns only the ancestor handle

closed time in 16 days

enricogior

issue commentmicrosoft/PowerToys

[DevDocs] Improve documentation for hwnd_cache

hwnd_data_cahce was removed, so this is obsolete

enricogior

comment created time in 16 days

push eventmicrosoft/PowerToys

Bartosz Sosnowski

commit sha 0fdc1d0a1fce2857923d5044d090df6c3b7fe835

ShortcutGuide, FancyZones: split window filtering (#1225) Splits the code use to filter windows for FancyZones and the "active window" for the ShortcutGuide. The FancyZones logic is preserved and merged into a single function. We keep it in common.h, as it might be also used in other PowerToys, like maximized to new desktop. We do however change the return type to be more descriptive. It also returns a separate flag for if the window has a visible owner. This can be used to implement the approved apps list. For the ShortcutGuide, the logic is relaxed to include more windows. One example are Explorer properties windows. Those are (and should) filtered by the FancyZones, but should appear in the window preview in the SCG. The new return type also includes information if the window will react to the default Windows Snap. This is not ideal though. Currently, SCG can only disable the entire "Windows Controls" group. OTOH windows like "Save As..." dialogs can be snapped to corners etc., but cannot be minimized nor maximized. Until SCG can separately disable those buttons we will display the buttons in the enabled state only if the window supports all settings. In the future, we should integrate FancyZones snap override here too.

view details

push time in 16 days

PR merged microsoft/PowerToys

ShortcutGuide, FancyZones: split window filtering

Summary of the Pull Request

(This requires that #1223 lands first, relevant changes are in this commit) (edit: PR landed)

Splits the code use to filter windows for FancyZones and the "active window" for the ShortcutGuide. The FancyZones logic is preserved and merged into a single function. We keep it in common.h, as it might be also used in other PowerToys, like maximized to new desktop. We do however change the return type to be more descriptive. It also returns a separate flag for if the window has a visible owner. This can be used to implement the approved apps list.

For the ShortcutGuide, the logic is relaxed to include more windows. One example are Explorer properties windows. Those are (and should) filtered by the FancyZones, but should appear in the window preview in the SCG.

The new return type also includes information if the window will react to the default Windows Snap. This is not ideal though. Currently, SCG can only disable the entire "Windows Controls" group. OTOH windows like "Save As..." dialogs can be snapped to corners etc., but cannot be minimized nor maximized. Until SCG can separately disable those buttons we will display the buttons in the enabled state only if the window supports all settings. In the future, we should integrate FancyZones snap override here too.

PR Checklist

  • [x] Applies to #1187
  • [x] CLA signed.

Validation Steps Performed

Manual. Tested with GOG Galaxy, Notepad and its Save As.. dialog, XYeplorer and TaskView. In all cases, FZ behaved as the current master. SCG displays correctly Explorer properties windows.

+96 -61

0 comment

6 changed files

bzoz

pr closed time in 16 days

push eventbzoz/PowerToys

Bartosz Sosnowski

commit sha 5d8e89480231cba3215420d3fa35291c8f81daa2

FancyZones: if window is not interesting, allow Windows snap (#1186) Do not swallow WinKey+Arrow events for non-interesting windows. This makes apps that are in the "excluded apps" list behave as if "Override windows snap keys" is disabled - they will react to the Windows default snap.

view details

Bartosz Sosnowski

commit sha 09d1af9c46a83c5bbe408b958ce04849a89e43ba

Common: remove hwnd_data_cache (#1223) The cache was introduced to improve performance by not querying the OS for the window process path every time we need to check if the window is interesting to FancyZones. Since then other changes were made to the the way we check the windows. Right now, the IsInterestingWindow function is called when: 1) WinKey + arrows are used 2) window is started to be dragged 3) window is created 1) and 2) are initiated by the user, happen only once per interaction so their performance impact can be dismissed. The 3) happens all the time but for the most part the check for WS_CHILD or GetAncestor(window, GA_ROOT) == window will filter those out. In the end, only top-level windows will be queried for their path. Removing the cache improves code readability and will make code maintenance easier.

view details

Bartosz Sosnowski

commit sha 9663be1a133c4e97f5c89ab31e6ce36849beac97

ShortcutGuide, FancyZones: split window filtering Splits the code use to filter windows for FancyZones and the "active window" for the ShortcutGuide. The FancyZones logic is preserved and merged into a single function. We keep it in common.h, as it might be also used in other PowerToys, like maximized to new desktop. We do however change the return type to be more descriptive. It also returns a separate flag for if the window has a visible owner. This can be used to implement the approved apps list. For the ShortcutGuide, the logic is relaxed to include more windows. One example are Explorer properties windows. Those are (and should) filtered by the FancyZones, but should appear in the window preview in the SCG. The new return type also includes information if the window will react to the default Windows Snap. This is not ideal though. Currently, SCG can only disable the entire "Windows Controls" group. OTOH windows like "Save As..." dialogs can be snapped to corners etc., but cannot be minimized nor maximized. Until SCG can separately disable those buttons we will display the buttons in the enabled state only if the window supports all settings. In the future, we should integrate FancyZones snap override here too.

view details

push time in 17 days

push eventmicrosoft/PowerToys

Bartosz Sosnowski

commit sha 09d1af9c46a83c5bbe408b958ce04849a89e43ba

Common: remove hwnd_data_cache (#1223) The cache was introduced to improve performance by not querying the OS for the window process path every time we need to check if the window is interesting to FancyZones. Since then other changes were made to the the way we check the windows. Right now, the IsInterestingWindow function is called when: 1) WinKey + arrows are used 2) window is started to be dragged 3) window is created 1) and 2) are initiated by the user, happen only once per interaction so their performance impact can be dismissed. The 3) happens all the time but for the most part the check for WS_CHILD or GetAncestor(window, GA_ROOT) == window will filter those out. In the end, only top-level windows will be queried for their path. Removing the cache improves code readability and will make code maintenance easier.

view details

push time in 17 days

PR merged microsoft/PowerToys

Common: remove hwnd_data_cache

Summary of the Pull Request

The cache was introduced to improve performance by not querying the OS for the window process path every time we need to check if the window is interesting to FancyZones. Since then other changes where made to the way we check the windows. Right now, the IsInterestingWindow function is called when:

  1. WinKey + arrows are used
  2. window is started to be dragged
  3. window is created

1 and 2 are initiated by the user, happen only once per interaction so their performance impact can be dismissed. The 3) happens all the time, but for the most part the check for WS_CHILD or GetAncestor(window, GA_ROOT) == window will filter those out. In the end only top-level windows will be queried for their path.

Removing the cache improves code readability and will make code maintenance easier.

This PR only refactored the code used to filter the windows. It moved the logic from hwnd_data_cache to the get_filtered_base_window_and_path only dropping the caching of the executable path.

<!-- Please review the items on the PR checklist before submitting-->

PR Checklist

  • [x] Applies to #1187
  • [x] CLA signed.

Validation Steps Performed

Unit tests. Tested with GOG Galaxy, Notepad and its Save As.. dialog, XYeplorer and TaskView. In all cases, FZ behaved as the current master.

+60 -197

1 comment

6 changed files

bzoz

pr closed time in 17 days

PR opened microsoft/PowerToys

ShortcutGuide, FancyZones: split window filtering

Summary of the Pull Request

(This requires that #1223 lands first, relevant changes are in this commit)

Splits the code use to filter windows for FancyZones and the "active window" for the ShortcutGuide. The FancyZones logic is preserved and merged into a single function. We keep it in common.h, as it might be also used in other PowerToys, like maximized to new desktop. We do however change the return type to be more descriptive. It also returns a separate flag for if the window has a visible owner. This can be used to implement the approved apps list.

For the ShortcutGuide, the logic is relaxed to include more windows. One example are Explorer properties windows. Those are (and should) filtered by the FancyZones, but should appear in the window preview in the SCG.

The new return type also includes information if the window will react to the default Windows Snap. This is not ideal though. Currently, SCG can only disable the entire "Windows Controls" group. OTOH windows like "Save As..." dialogs can be snapped to corners etc., but cannot be minimized nor maximized. Until SCG can separately disable those buttons we will display the buttons in the enabled state only if the window supports all settings. In the future, we should integrate FancyZones snap override here too.

PR Checklist

  • [x] Applies to #1187
  • [x] CLA signed.

Validation Steps Performed

Manual. Tested with GOG Galaxy, Notepad and its Save As.. dialog, XYeplorer and TaskView. In all cases, FZ behaved as the current master. SCG displays correctly Explorer properties windows.

+144 -246

0 comment

10 changed files

pr created time in 17 days

create barnchbzoz/PowerToys

branch : split-shortcutguide-and-fancyzones

created branch time in 17 days

pull request commentmicrosoft/PowerToys

Common: remove hwnd_data_cache

Updated, PTAL

bzoz

comment created time in 17 days

push eventbzoz/PowerToys

Bartosz Sosnowski

commit sha 1b5d0b1db3d3446408aa50b85733a243f229f2d6

fixup: comment and make is_system_window require class_name

view details

push time in 17 days

Pull request review commentmicrosoft/PowerToys

Common: remove hwnd_data_cache

 std::optional<POINT> get_mouse_pos() {   } } +static bool is_system_window(HWND hwnd, const char* class_name = nullptr) {

Ok

bzoz

comment created time in 17 days

Pull request review commentmicrosoft/PowerToys

Common: remove hwnd_data_cache

 std::optional<RECT> get_button_pos(HWND hwnd); std::optional<RECT> get_window_pos(HWND hwnd); // Gets mouse postion. std::optional<POINT> get_mouse_pos();-// Gets active window, filtering out all "non standard" windows like the taskbar, etc.-HWND get_filtered_active_window();+ // Gets window ancestor (usualy the window we want to do stuff with), filtering out all "non standard" windows like the taskbar, etc. and provide the app process path struct WindowAndProcPath {   HWND hwnd = nullptr;   std::wstring process_path; }; WindowAndProcPath get_filtered_base_window_and_path(HWND window);+// Gets active window, filtering out all "non standard" windows like the taskbar, etc.

This would not be a change related to this PR, I'll make a separate one for this and some other SCG tweak.

bzoz

comment created time in 17 days

PR opened microsoft/PowerToys

Common: remove hwnd_data_cache

Summary of the Pull Request

The cache was introduced to improve performance by not querying the OS for the window process path every time we need to check if the window is interesting to FancyZones. Since then other changes where made to the way we check the windows. Right now, the IsInterestingWindow function is called when:

  1. WinKey + arrows are used
  2. window is started to be dragged
  3. window is created

1 and 2 are initiated by the user, happen only once per interaction so their performance impact can be dismissed. The 3) happens all the time, but for the most part the check for WS_CHILD or GetAncestor(window, GA_ROOT) == window will filter those out. In the end only top-level windows will be queried for their path.

Removing the cache improves code readability and will make code maintenance easier.

This PR only refactored the code used to filter the windows. It moved the logic from hwnd_data_cache to the get_filtered_base_window_and_path only dropping the caching of the executable path.

<!-- Please review the items on the PR checklist before submitting-->

PR Checklist

  • [x] Applies to #1187
  • [x] CLA signed.

Validation Steps Performed

Unit tests. Tested with GOG Galaxy, Notepad and its Save As.. dialog, XYeplorer and TaskView. In all cases, FZ behaved as the current master.

+61 -197

0 comment

6 changed files

pr created time in 17 days

create barnchbzoz/PowerToys

branch : remove-hwnd-cache

created branch time in 17 days

push eventmicrosoft/PowerToys

Bartosz Sosnowski

commit sha 5d8e89480231cba3215420d3fa35291c8f81daa2

FancyZones: if window is not interesting, allow Windows snap (#1186) Do not swallow WinKey+Arrow events for non-interesting windows. This makes apps that are in the "excluded apps" list behave as if "Override windows snap keys" is disabled - they will react to the Windows default snap.

view details

push time in 17 days

PR merged microsoft/PowerToys

FancyZones: if window is not interesting, allow Windows snap

<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->

Summary of the Pull Request

Do not swallow <kbd>WinKey</kbd>+<kbd>Arrow</kbd> events for non-interesting windows. This makes apps that are in the "excluded apps" list behave as if "Override windows snap keys" is disabled - they will react to the Windows default snap.

This requires #1184 to be merged first. The changes specific to this PR are in the second commit.

<!-- Please review the items on the PR checklist before submitting-->

PR Checklist

  • [x] Applies to #1182
  • [x] CLA signed.
  • [x] Tests added/passed

Detailed Description of the Pull Request / Additional comments

  • This does not include CycleActiveZoneSet. For whatever reason <kbd>WinKey</kbd>+<kbd>Ctrl</kbd>+<kbd>Nubers</kbd> seems to not work at all.
  • The "Save As..." dialog can be snapped using <kbd>WinKey</kbd>+<kbd>Arrow</kbd> when the "Override windows snap keys" is disabled. With this change the "Save As..." dialog will always react to the Windows default snap keys.

Validation Steps Performed

Unit test Notepad and Notepads Save As dialog with and without it in the excluded apps.

+5 -4

3 comments

2 changed files

bzoz

pr closed time in 17 days

pull request commentmicrosoft/PowerToys

FancyZones: if window is not interesting, allow Windows snap

Changed the description to: "To exclude an application from snapping to zones add its name here (one per line). Excluded apps will react to the Windows Snap regardless of all other settings."

bzoz

comment created time in 17 days

push eventbzoz/PowerToys

Bartosz Sosnowski

commit sha 211c13e56f67a8f81c2589ee6dd3815ed5320803

fixup: add note to the excluded apps list description

view details

push time in 17 days

issue commentmicrosoft/PowerToys

Lock the numeric keypad to always and forever use numbers

It looks like there is no Windows way to lock the num-lock key. We can, however (at least I think this should work):

  • get the current NumLock state and if needed toggle it. There is even MSDN example of exactly this.
  • use keyboard hook to intercept and ignore all NumLock key presses.
  • unfortunately, if PT are not running as admin, we won't be able to intercept NumLock keys in elevated apps. We should probably test the NumLock state from time to time and restore it if it was changed.

This is a great thing for a first-time contribution. A new, separate, small powertoy.

titoBouzout

comment created time in 17 days

issue commentmicrosoft/PowerToys

Task View is opening in Fancy Zone region

Fixed landed in master. In the next release, FancyZones will ignore TaskView.

rayzorben

comment created time in 18 days

issue commentmicrosoft/PowerToys

[FancyZones] - Some apps no longer snap after 0.14.1

Fix landed in master, next release will support those apps.

OLLI-S

comment created time in 18 days

issue commentmicrosoft/PowerToys

FancyZones 14.1 not working with Faststone Maxview 3.1

Fix landed in master, next release will support this app.

Huxen

comment created time in 18 days

pull request commentmicrosoft/PowerToys

FancyZones: if window is not interesting, allow Windows snap

I've rebased it on master after #1184 landed, so it is ready to be merged. I'll reword the excluded apps description.

bzoz

comment created time in 18 days

push eventmicrosoft/PowerToys

Bartosz Sosnowski

commit sha 0ecfbfad53a79b9ac287a2cad3b7a1fe22e5a468

FancyZones: filter out WM_POPUP windows if they dont have maximize/minimize button or a sizable frame (#1212) This filters out TaskView and Win32 menus.

view details

push time in 18 days

PR merged microsoft/PowerToys

FancyZones: filter out WM_POPUP windows if they dont have maximize/minimize button or a resizable frame

Summary of the Pull Request

This filters out TaskView and Win32 menus.

PR Checklist

  • [x] Applies to #1159
  • [x] CLA signed.

Validation Steps Performed

Manual using PaswordSafe, 1Password, TortoiseSVN, GOG Galaxy beta, GlassWire, VS Code and Battle.net launcher

+8 -0

4 comments

1 changed file

bzoz

pr closed time in 18 days

push eventmicrosoft/PowerToys

Bartosz Sosnowski

commit sha ed35a143ec5ded2875698aa23f505dd93162a0c8

FancyZones: allow windows with invisible or zero-sized owner to be zonable (#1216)

view details

push time in 18 days

PR merged microsoft/PowerToys

FancyZones: allow windows with invisible or zero-sized owner to be zonable

Summary of the Pull Request

Further improve what can and cannot be zonable. This fixes a case for some apps that run an invisible top-level window.

<!-- Please review the items on the PR checklist before submitting-->

PR Checklist

  • [x] Applies to #1204 #894 (SUMo, XYplorer and the self-coded app from the 3rd comment)
  • [x] CLA signed.

Validation Steps Performed

Manual. Tested with PaswordSafe, 1Password, TortoiseSVN, GOG Galaxy beta, GlassWire, VS Code and Battle.net launcher which still can be zonable. Tested with Notepad: Save As is not zonable, File menu and the about window is not getting zoned on creation. Tested SUMo, XYplorer, the self-coded app, and the FastZone Image View app - those can now be zoned as expected.

+21 -1

0 comment

1 changed file

bzoz

pr closed time in 18 days

PR opened microsoft/PowerToys

FancyZones: allow windows with invisible or zero-sized owner to be zonable

Summary of the Pull Request

Further improve what can and cannot be zonable. This fixes a case for some apps that run an invisible top-level window.

<!-- Please review the items on the PR checklist before submitting-->

PR Checklist

  • [x] Applies to #1204 #894 (SUMo, XYplorer and the self-coded app from the 3rd comment)
  • [x] CLA signed.

Validation Steps Performed

Manual. Tested with PaswordSafe, 1Password, TortoiseSVN, GOG Galaxy beta, GlassWire, VS Code and Battle.net launcher which still can be zonable. Tested with Notepad: Save As is not zonable, File menu and the about window is not getting zoned on creation. Tested SUMo, XYplorer, the self-coded app, and the FastZone Image View app - those can now be zoned as expected.

+21 -1

0 comment

1 changed file

pr created time in 19 days

create barnchbzoz/PowerToys

branch : zone-with-invisible-owner

created branch time in 19 days

issue commentmicrosoft/PowerToys

Outlook new email window is snapped to last used zone.

Mail windows are all top-level windows with no relation to the main window, except that they are created by the same process. We would have to add a check if another window with the same PID is not already assigned to a zone.

enricogior

comment created time in 19 days

pull request commentmicrosoft/PowerToys

FancyZones: filter out WM_POPUP windows if they dont have maximize/minimize button or a resizable frame

I guess "positive" - tested if all the windows that used to work still work. The only "negative" test was that the TaskView window (Win + Tab) is no more zonable.

bzoz

comment created time in 19 days

pull request commentmicrosoft/PowerToys

FancyZones: filter out WM_POPUP windows if they dont have maximize/minimize button or a resizable frame

The change does not affect those apps, especially TortoiseSVN uses WS_POPUP a lot in its windows and is still zonable as expected.

bzoz

comment created time in 19 days

PR opened microsoft/PowerToys

FancyZones: filter out WM_POPUP windows if they dont have maximize/minimize button or a resizable frame

Summary of the Pull Request

This filters out TaskView and Win32 menus.

PR Checklist

  • [x] Applies to #1159
  • [x] CLA signed.

Validation Steps Performed

Manual using PaswordSafe, 1Password, TortoiseSVN, GOG Galaxy beta, GlassWire, VS Code and Battle.net launcher

+8 -0

0 comment

1 changed file

pr created time in 19 days

create barnchbzoz/PowerToys

branch : filter-popup-windows

created branch time in 19 days

issue commentmicrosoft/PowerToys

FancyZones 14.1 not working with Faststone Maxview 3.1

As with #894, there is an invisible parent window.

Huxen

comment created time in 19 days

issue commentmicrosoft/PowerToys

Fancyzones editor not showing if RTSS is running

I still can't get this to reproduce. What exact RTSS version are you running?

clamatac

comment created time in 20 days

push eventbzoz/PowerToys

yuyoyuppe

commit sha aa714f7d80b20be5cce26f03d75173613c0fa278

Runner: fix startup task state setting for MSIX (#1181)

view details

Betsegaw Tadele

commit sha b4f81a0c2a09631c16958dd6b71c9c568b46c094

Import the source code for Window Walker (#1177) Import the codebase for Window Walker - Not loaded into the module list - Not added it to the installer list.

view details

sakariya

commit sha b00ce8789fe66b1251e8eb9923948cacf07f36fb

Adding KeyManager spec (#1112) * Adding KeyManager spec * adding req changes * req changes * changed wording * md edits * edit md * Update doc/specs/KeyboardManager.md Co-Authored-By: Jeroen van Warmerdam <jeronevw@hotmail.com> * further edits * Update KeyboardManager.md * Update KeyboardManager.md Co-authored-by: Jeroen van Warmerdam <jeronevw@hotmail.com>

view details

Clint Rutkas

commit sha 4ef8f3da2b20a09e8f2b6e41dc7be282dbb6d43c

Update README.md (#1198)

view details

Bartosz Sosnowski

commit sha 25e882eb7803035df6a6e6a8f21b1f19902553b6

Fancyzones: unify window filtering (#1184) Makes FancyZone use the same code for filtering windows when windows are being dragged and when moved by WinKey + arrows.

view details

Bartosz Sosnowski

commit sha 1f390c824199908fea3795bd298980bbba39a2a7

FancyZones: if window is not interesting, allow Windows snap

view details

push time in 20 days

issue commentmicrosoft/PowerToys

Fancyzones editor not showing if RTSS is running

We already saw that issue (#455) but we could not reproduce.

@clamatac, what PowerToys version are you running?

clamatac

comment created time in 20 days

push eventmicrosoft/PowerToys

Bartosz Sosnowski

commit sha 25e882eb7803035df6a6e6a8f21b1f19902553b6

Fancyzones: unify window filtering (#1184) Makes FancyZone use the same code for filtering windows when windows are being dragged and when moved by WinKey + arrows.

view details

push time in 20 days

PR merged microsoft/PowerToys

Fancyzones: unify window filtering

Summary of the Pull Request

Makes FancyZone use the same code for filtering windows when windows are being dragged and when moved by WinKey + arrows.

This is mostly a code refactor, but it also solves one issue.

<!-- Please review the items on the PR checklist before submitting-->

PR Checklist

  • [x] Applies (partly) to #1182
  • [x] CLA signed.
  • [x] Tests added/passed

Detailed Description of the Pull Request / Additional comments

  • The IsInterestingWindow method is moved "as is" to the FancyZones.cpp.
  • 3 IsInterestingWindow calls were moved to the FancyZones.cpp in appropriate places
  • In 2 places in FancyZones.cpp where we used get_filtered_active_window() and GetWindow(window, GW_OWNER) calls, we now use IsInteresetingWindow.
  • The m_movedWindow is removed. It fixed an issue when a Chrom tab is dragged into another Chrome instance, the style would change so that the window would become uninteresting. FancyZones would be stuck in "window is dragged mode", so we kept a reference to the dragged window to make sure we disengage the display of the zones. In the FancyZones.cpp the reference is already kept in m_windowMoveSize, we will reuse it.
  • For #1182 we should probably not swallow the keyboard events. Excluded apps should probably be able to use regular Windows snapping.

Validation Steps Performed

Unit tests Manual tests with Notepad, Git Extensions and Chrome

+55 -66

6 comments

2 changed files

bzoz

pr closed time in 20 days

issue commentmicrosoft/PowerToys

PowerToys: very fast switching between apps with Alt + Tab should not show the window overview (like on linux/mac) to be less distracting

If the next window would be brought to the top, the current window would become the next window. In the end using Alt-Esc would switch between only two most recent windows, completely ignoring all other apps.

kraoli

comment created time in 22 days

issue closedmicrosoft/PowerToys

Python IDLE is not working with fancyZones

<!-- Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. -->

Environment

Windows build number: Microsoft Windows [Version 10.0.18362.535]
PowerToys version: 0.14.1.0
PowerToy module for which you are reporting the bug (if applicable):

Steps to reproduce

  1. Download python 3.8 from python.org
  2. Open the python IDLE by searching the start menu.
  3. Try to use any fancyZone predefined layout.
  4. open the python shell from the IDLE menu by clicking Run\Open Shell.
  5. Press SHIFT while dragging the IDLE or the Shell window to the predefined zones.

<!-- A description of how to trigger this bug. -->

Expected behavior

The opened windows should be organized according to the predefined fancyZones.

<!-- A description of what you're expecting, possibly containing screenshots or reference material. -->

Actual behavior

The predefined zones doesn't show while holding SHIFT and dragging the mentioned windows.

<!-- What's actually happening? --> The predefined zones doesn't show

Screenshots

<!-- If applicable, add screenshots to help explain your problem. -->

closed time in 23 days

joo77

issue commentmicrosoft/PowerToys

Python IDLE is not working with fancyZones

Thanks for your report.

This was fixed in #1076, Python IDLE will work with the next PT release.

joo77

comment created time in 23 days

issue commentmicrosoft/PowerToys

PowerToys: very fast switching between apps with Alt + Tab should not show the window overview (like on linux/mac) to be less distracting

@skagon besides it being hard to press is there anything else that you do not like in it?

kraoli

comment created time in 23 days

pull request commentmicrosoft/PowerToys

Fancyzones: unify window filtering

That's the same behavior as with 0.14

bzoz

comment created time in 23 days

issue commentmicrosoft/PowerToys

PowerRename randomly crashes Windows Explorer

Hi, thanks for the report.

Could you check if this still reproduces with the latest release?

nitishvijai

comment created time in 24 days

Pull request review commentmicrosoft/PowerToys

Runner: fix startup task state setting for MSIX

 #pragma once -bool running_as_packaged();+#include <future>++#include <winrt/Windows.ApplicationModel.h>+++namespace winstore+{+    using winrt::Windows::ApplicationModel::StartupTaskState;++    bool running_as_packaged();+    std::future<void> switch_startup_task_state_async(const bool enabled);+    std::future<StartupTaskState> get_startup_task_status_async();+}

Since we use .get() and .wait() anyway on the futures, do we need them?

yuyoyuppe

comment created time in 24 days

Pull request review commentmicrosoft/PowerToys

Runner: fix startup task state setting for MSIX

 #pragma once -bool running_as_packaged();+#include <future>++#include <winrt/Windows.ApplicationModel.h>+++namespace winstore+{+    using winrt::Windows::ApplicationModel::StartupTaskState;++    bool running_as_packaged();+    std::future<void> switch_startup_task_state_async(const bool enabled);+    std::future<StartupTaskState> get_startup_task_status_async();+}

missing new line

yuyoyuppe

comment created time in 24 days

push eventbzoz/PowerToys

Bartosz Sosnowski

commit sha 45da2688f5e4f23961e82cdff329fda78b4e4be7

fixup: reverse order in 2 if-s

view details

push time in 24 days

pull request commentmicrosoft/PowerToys

Fancyzones: unify window filtering

Made a PR for testing the default Window snap: https://github.com/microsoft/PowerToys/pull/1186. There is one side effect, things like "Save As..." dialog will always react to the default Windows snap keys.

bzoz

comment created time in 24 days

PR opened microsoft/PowerToys

FancyZones: if window is not interesting, allow Windows snap

<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->

Summary of the Pull Request

Do not swallow <kbd>WinKey</kbd>+<kbd>Arrow</kbd> events for non-interesting windows. This makes apps that are in the "excluded apps" list behave as if "Override windows snap keys" is disabled - they will react to the Windows default snap.

This requires #1184 to be merged first. The changes specific to this PR are in the second commit.

<!-- Please review the items on the PR checklist before submitting-->

PR Checklist

  • [x] Applies to #1182
  • [x] CLA signed.
  • [x] Tests added/passed

Detailed Description of the Pull Request / Additional comments

  • This does not include CycleActiveZoneSet. For whatever reason <kbd>WinKey</kbd>+<kbd>Ctrl</kbd>+<kbd>Nubers</kbd> seems to not work at all.
  • The "Save As..." dialog can be snapped using <kbd>WinKey</kbd>+<kbd>Arrow</kbd> when the "Override windows snap keys" is disabled. With this change the "Save As..." dialog will always react to the Windows default snap keys.

Validation Steps Performed

Unit test Notepad and Notepads Save As dialog with and without it in the excluded apps.

+60 -70

0 comment

2 changed files

pr created time in 24 days

create barnchbzoz/PowerToys

branch : dont-swallow-kbd

created branch time in 24 days

PR opened microsoft/PowerToys

Fancyzones: unify window filtering

Summary of the Pull Request

Makes FancyZone use the same code for filtering windows when windows are being dragged and when moved by WinKey + arrows.

This is mostly a code refactor, but it also solves one issue.

<!-- Please review the items on the PR checklist before submitting-->

PR Checklist

  • [x] Applies (partly) to #1182
  • [x] CLA signed.
  • [x] Tests added/passed

Detailed Description of the Pull Request / Additional comments

  • The IsInterestingWindow method is moved "as is" to the FancyZones.cpp.
  • 3 IsInterestingWindow calls were moved to the FancyZones.cpp in appropriate places
  • In 2 places in FancyZones.cpp where we used get_filtered_active_window() and GetWindow(window, GW_OWNER) calls, we now use IsInteresetingWindow.
  • The m_movedWindow is removed. It fixed an issue when a Chrom tab is dragged into another Chrome instance, the style would change so that the window would become uninteresting. FancyZones would be stuck in "window is dragged mode", so we kept a reference to the dragged window to make sure we disengage the display of the zones. In the FancyZones.cpp the reference is already kept in m_windowMoveSize, we will reuse it.
  • For #1182 we should probably not swallow the keyboard events. Excluded apps should probably be able to use regular Windows snapping.

Validation Steps Performed

Unit tests Manual tests with Notepad, Git Extensions and Chrome

+55 -66

0 comment

2 changed files

pr created time in 24 days

create barnchbzoz/PowerToys

branch : unify-filtering

created branch time in 24 days

issue openedmicrosoft/PowerToys

FancyZones: WinKey + arrow ignore excluded apps list

Environment

PowerToys version: master

Steps to reproduce

  • Create zones, have "override windows snap keys" setting on
  • Add app to the "excluded apps list"
  • Try to zone it with WinKey + arrow

Expected behavior

  • App is not assigned to a zone

Actual behavior

  • App is assigned to a zone

created time in 24 days

Pull request review commentmicrosoft/PowerToys

MSIX: initial implement notifications library

 Helper methods for the settings.  #### Start visible helper: [header](/src/common/start_visible.h) [source](/src/common/start_visible.cpp) Contains function to test if the Start menu is visible.++# Toast Notifications++#### Notifications API [header](/src/common/notifications.h) [source](/src/common/notifications.cpp)+To use UWP-style toast notifications, simply include the header and call one of these functions:++```cpp+    void show_toast(std::wstring_view message);       // #1+    +    void show_toast_background_activated(             // #2+      std::wstring_view background_handler_id,+      std::wstring_view message,+      std::vector<std::wstring_view> button_labels);+```+We might add more functions in the future if the need arises, e.g. `show_toast_xml` which will accept raw XML for rich customization.++Description:+- `#1` is for sending simple notifications without any callbacks or buttons+- `#2` is capable of showing a toast with multiple buttons and background activation+- `message` is a plain-text argument++Implement a toast activation handler/callback as a function in [handler_functions.cpp](/src/common/notifications_winrt/handler_functions.cpp) and register its `background_handler_id` via `handlers_map`, e.g.:++```cpp+// Your .cpp where you'd like to show a toast++#include <common/notifications.h>++void some_func() {+// ...+  notifications::show_toast_background_activated(+    L"awesome_toast",                                                   // activation handler id+    L"Toast message!",                                                  // text displayed in a toast+    {L"Press me!", L"Also could press me!", L"I'm here to be pressed!"} // buttons in a toast+  );+```++```cpp+// handler_functions.cpp+void awesome_toast_handler(IBackgroundTaskInstance, const size_t button_id)+{+  switch(button_id)+  {+    case 0:+      // handle "Press me!" button click+    case 1:+      // handle "Also could press me!" button click+    case 2:+      // handle "I'm here to be pressed!" button click+  }+}++namespace+{+  const std::unordered_map<std::wstring_view, handler_function_t> handlers_map = {

Can we have something like a "add_handler" function?

yuyoyuppe

comment created time in 24 days

Pull request review commentmicrosoft/PowerToys

MSIX: initial implement notifications library

 Helper methods for the settings.  #### Start visible helper: [header](/src/common/start_visible.h) [source](/src/common/start_visible.cpp) Contains function to test if the Start menu is visible.++# Toast Notifications++#### Notifications API [header](/src/common/notifications.h) [source](/src/common/notifications.cpp)+To use UWP-style toast notifications, simply include the header and call one of these functions:++```cpp+    void show_toast(std::wstring_view message);       // #1+    +    void show_toast_background_activated(             // #2+      std::wstring_view background_handler_id,+      std::wstring_view message,+      std::vector<std::wstring_view> button_labels);+```+We might add more functions in the future if the need arises, e.g. `show_toast_xml` which will accept raw XML for rich customization.++Description:+- `#1` is for sending simple notifications without any callbacks or buttons+- `#2` is capable of showing a toast with multiple buttons and background activation+- `message` is a plain-text argument++Implement a toast activation handler/callback as a function in [handler_functions.cpp](/src/common/notifications_winrt/handler_functions.cpp) and register its `background_handler_id` via `handlers_map`, e.g.:++```cpp+// Your .cpp where you'd like to show a toast++#include <common/notifications.h>++void some_func() {+// ...+  notifications::show_toast_background_activated(+    L"awesome_toast",                                                   // activation handler id+    L"Toast message!",                                                  // text displayed in a toast+    {L"Press me!", L"Also could press me!", L"I'm here to be pressed!"} // buttons in a toast+  );+```++```cpp+// handler_functions.cpp

Is this the src/common/notifications_winrt/handler_functions.cpp file? If so, we should make it explicit.

yuyoyuppe

comment created time in 24 days

Pull request review commentmicrosoft/PowerToys

MSIX: initial implement notifications library

+#include "pch.h"+#include "notifications.h"++#include <unknwn.h>+#include <winrt/base.h>+#include <winrt/Windows.Foundation.h>+#include <winrt/Windows.Data.Xml.Dom.h>+#include <winrt/Windows.Foundation.Collections.h>+#include <winrt/Windows.UI.Notifications.h>+#include <winrt/Windows.ApplicationModel.Background.h>++using namespace winrt::Windows::ApplicationModel::Background;+using winrt::Windows::Data::Xml::Dom::XmlDocument;+using winrt::Windows::UI::Notifications::ToastNotification;+using winrt::Windows::UI::Notifications::ToastNotificationManager;++namespace+{+    constexpr std::wstring_view TASK_NAME = L"PowerToysBackgroundNotificationsHandler";+    constexpr std::wstring_view TASK_ENTRYPOINT = L"PowerToysNotifications.BackgroundHandler";+}++void notif::register_background_toast_handler()+{+    // Re-request access to clean up from our previous versions+    BackgroundExecutionManager::RemoveAccess();+    BackgroundExecutionManager::RequestAccessAsync().get();++    BackgroundTaskBuilder builder;+    ToastNotificationActionTrigger trigger{ L"PowerToys" };+    builder.SetTrigger(trigger);+    builder.TaskEntryPoint(TASK_ENTRYPOINT);+    builder.Name(TASK_NAME);++    const auto tasks = BackgroundTaskRegistration::AllTasks();+    const bool already_registered = std::any_of(begin(tasks), end(tasks), [=](const auto& task) {+        return task.Value().Name() == TASK_NAME;+    });+    if (already_registered)+    {+        return;+    }+    try+    {+        (void)builder.Register();+    }+    catch (...)+    {+        // Couldn't register the task, nothing we can do+    }+}++void notif::show_toast(std::wstring_view message)+{+    show_toast_background_activated(L"Unknown", message, {});+}++void notif::show_toast_background_activated(std::wstring_view background_handler_id, std::wstring_view message, std::vector<std::wstring_view> button_labels)

Maybe we should escape the strings? The message can be put in <![CDATA[ ... ]]>, for button_labels we could just change all " to&quot;. Sooner or later someone will try to have a button with a quote.

yuyoyuppe

comment created time in 24 days

Pull request review commentmicrosoft/PowerToys

MSIX: initial implement notifications library

+#pragma once++#include <string_view>+#include <vector>++namespace notif

Can we have a full Notifications here?

yuyoyuppe

comment created time in 24 days

Pull request review commentmicrosoft/PowerToys

MSIX: initial implement notifications library

+#pragma once++#include <string_view>+#include <vector>++namespace notif+{+    void register_background_toast_handler();++    void show_toast(std::wstring_view message);+    void show_toast_background_activated(std::wstring_view background_handler_id, std::wstring_view message, std::vector<std::wstring_view> button_labels);

What's this background_handler_id and why it is not in show_toast?

yuyoyuppe

comment created time in 24 days

issue commentmicrosoft/PowerToys

PowerToys: very fast switching between apps with Alt + Tab should not show the window overview (like on linux/mac) to be less distracting

@skagon, did you try <kbd>Alt</kbd>+<kbd>Esc</kbd> and <kbd>Alt</kbd>+<kbd>Shift</kbd>+<kbd>Esc</kbd>?

kraoli

comment created time in 24 days

Pull request review commentmicrosoft/PowerToys

MSIX: hide the "Run at Startup" option if running as packaged

 export class GeneralSettings extends React.Component <any, any> {         }         <Separator />         <Text variant='xLarge'>General</Text>-        <BoolToggleSettingsControl-          setting={{display_name: 'Run at Startup', value: this.state.settings.general.startup}}-          on_change={this.parent_on_change}-          ref={(input) => {this.startup_reference=input;}}-        />+        {this.state.settings.general.startup != null &&

No, the startup should stay. I meant adding a new, separate flag

yuyoyuppe

comment created time in 25 days

Pull request review commentmicrosoft/PowerToys

MSIX: hide the "Run at Startup" option if running as packaged

 export class GeneralSettings extends React.Component <any, any> {         }         <Separator />         <Text variant='xLarge'>General</Text>-        <BoolToggleSettingsControl-          setting={{display_name: 'Run at Startup', value: this.state.settings.general.startup}}-          on_change={this.parent_on_change}-          ref={(input) => {this.startup_reference=input;}}-        />+        {this.state.settings.general.startup != null &&

I think we should pass a "running as packaged" setting. It would be more readable.

yuyoyuppe

comment created time in 25 days

issue commentmicrosoft/PowerToys

[FancyZones] Web apps treated as normal browser window

I guess this would be a duplicate of https://github.com/microsoft/PowerToys/issues/652.

I don't know if there is a way to tell PWA apart. From the outside, they look like a Chrome window. They don't, however, have "Google Chrome" in their title. We could use that to detect them, but then again - e.g. Twitter title changes with the number of notifications.

tichun

comment created time in a month

issue commentmicrosoft/PowerToys

Task View is opening in Fancy Zone region

Can confirm, WinKey + arrows can move the TaskView to a zone.

Side note: the task view is more or less a normal explorer window, without an owner, with following styles: WS_POPUP WS_VISIBLE WS_CLIPSIBLINGS WS_POPUPWINDOW WS_EX_TOPMOST WS_EX_PALETTEWINDOW WS_EX_NOREDIRECTIONBITMAP

rayzorben

comment created time in a month

issue commentmicrosoft/PowerToys

[MSIX] MSIX build script should rebuild as well

I started doing this but didn't have time to finish it up: https://github.com/bzoz/PowerToys/blob/ps-build/build.ps1

crutkas

comment created time in a month

Pull request review commentmicrosoft/PowerToys

Initialize COM security for elevated settings process

 std::wstring get_resource_string(UINT resource_id, HINSTANCE instance, const wch //  extern "C" IMAGE_DOS_HEADER __ImageBase; // is added to the .cpp file. #define GET_RESOURCE_STRING(resource_id) get_resource_string(resource_id, reinterpret_cast<HINSTANCE>(&__ImageBase), L#resource_id)++// Helper class for various COM-related APIs, e.g working with security descriptors+template<typename T>+struct typed_storage+{+    std::unique_ptr<char[]> _buffer;+    inline explicit typed_storage(const DWORD size) :+        _buffer{ std::make_unique<char[]>(size) }+    {+    }+    inline operator T*()+    {+        return reinterpret_cast<T*>(_buffer.get());+    }+};++template<typename Callable>+struct on_scope_exit+{+    Callable _f;+    on_scope_exit(Callable f) :+        _f{ std::move(f) } {}++    ~on_scope_exit()+    {+        _f();+    }+};

Missing new line.

yuyoyuppe

comment created time in a month

pull request commentmicrosoft/PowerToys

FancyZones: add approved apps list and unify window filtering

@crutkas like in the excluded app list: .exe filename including the path

bzoz

comment created time in a month

Pull request review commentmicrosoft/PowerToys

Initialize COM security for elevated settings process

 std::optional<POINT> get_mouse_pos(); // Gets active window, filtering out all "non standard" windows like the taskbar, etc. HWND get_filtered_active_window(); // Gets window ancestor (usualy the window we want to do stuff with), filtering out all "non standard" windows like the taskbar, etc. and provide the app process path-struct WindowAndProcPath {-  HWND hwnd = nullptr;-  std::wstring process_path;+struct WindowAndProcPath

Can you remove those unrelated style changes? We should do the styling in a separate PR.

yuyoyuppe

comment created time in a month

Pull request review commentmicrosoft/PowerToys

Initialize COM security for elevated settings process

 void parse_args()     LocalFree(argument_list); } +void initialize_com_security_policy_for_webview()+{+    const wchar_t* security_descriptor =+        L"O:BA" // Owner: Builtin (local) administrator+        L"G:BA" // Group: Builtin (local) administrator+        L"D:"+        L"(A;;0x7;;;PS)" // Access allowed on COM_RIGHTS_EXECUTE, _LOCAL, & _REMOTE for Personal self+        L"(A;;0x3;;;SY)" // Access allowed on COM_RIGHTS_EXECUTE, & _LOCAL for Local system+        L"(A;;0x7;;;BA)" // Access allowed on COM_RIGHTS_EXECUTE, _LOCAL, & _REMOTE for Builtin (local) administrator+        L"(A;;0x3;;;S-1-15-3-1310292540-1029022339-4008023048-2190398717-53961996-4257829345-603366646)" // Access allowed on COM_RIGHTS_EXECUTE, & _LOCAL for Win32WebViewHost package capability+        L"S:"+        L"(ML;;NX;;;LW)"; // Integrity label on No execute up for Low mandatory level+    PSECURITY_DESCRIPTOR self_relative_sd{};+    if (!ConvertStringSecurityDescriptorToSecurityDescriptorW(security_descriptor, SDDL_REVISION_1, &self_relative_sd, nullptr))+    {+        return;+    }++    ON_SCOPE_EXIT([&] {+        LocalFree(self_relative_sd);+    });++    DWORD absolute_sd_size = 0;+    DWORD dacl_size = 0;+    DWORD group_size = 0;+    DWORD owner_size = 0;+    DWORD sacl_size = 0;++    if (MakeAbsoluteSD(self_relative_sd, nullptr, &absolute_sd_size, nullptr, &dacl_size, nullptr, &sacl_size, nullptr, &owner_size, nullptr, &group_size) ||+        GetLastError() != ERROR_INSUFFICIENT_BUFFER)

Can we split this? the || GetLastError() part is kinda confusing.

yuyoyuppe

comment created time in a month

Pull request review commentmicrosoft/PowerToys

Initialize COM security for elevated settings process

 std::wstring get_resource_string(UINT resource_id, HINSTANCE instance, const wch //  extern "C" IMAGE_DOS_HEADER __ImageBase; // is added to the .cpp file. #define GET_RESOURCE_STRING(resource_id) get_resource_string(resource_id, reinterpret_cast<HINSTANCE>(&__ImageBase), L#resource_id)++// Helper class for various COM-related APIs, e.g working with security descriptors+template<typename T>+struct typed_storage+{+    std::unique_ptr<char[]> _buffer;+    inline explicit typed_storage(const DWORD size) :+        _buffer{ std::make_unique<char[]>(size) }+    {+    }+    inline operator T*()+    {+        return reinterpret_cast<T*>(_buffer.get());+    }+};++template<typename Callable>+struct on_scope_exit_impl+{+    Callable _f;+    on_scope_exit_impl(Callable f) :+        _f{ std::move(f) } {}++    ~on_scope_exit_impl()+    {+        _f();+    }+};++#define ON_SCOPE_EXIT_CONCAT(a, b) ON_SCOPE_EXIT_XCONCAT(a, b)+#define ON_SCOPE_EXIT_XCONCAT(a, b) a##b+#define ON_SCOPE_EXIT(func) \

(or, if we want a macro, we can just put func(); in the destructor and not do the move thingy)

yuyoyuppe

comment created time in a month

Pull request review commentmicrosoft/PowerToys

Initialize COM security for elevated settings process

 std::wstring get_resource_string(UINT resource_id, HINSTANCE instance, const wch //  extern "C" IMAGE_DOS_HEADER __ImageBase; // is added to the .cpp file. #define GET_RESOURCE_STRING(resource_id) get_resource_string(resource_id, reinterpret_cast<HINSTANCE>(&__ImageBase), L#resource_id)++// Helper class for various COM-related APIs, e.g working with security descriptors+template<typename T>+struct typed_storage+{+    std::unique_ptr<char[]> _buffer;+    inline explicit typed_storage(const DWORD size) :+        _buffer{ std::make_unique<char[]>(size) }+    {+    }+    inline operator T*()+    {+        return reinterpret_cast<T*>(_buffer.get());+    }+};++template<typename Callable>+struct on_scope_exit_impl+{+    Callable _f;+    on_scope_exit_impl(Callable f) :+        _f{ std::move(f) } {}++    ~on_scope_exit_impl()+    {+        _f();+    }+};++#define ON_SCOPE_EXIT_CONCAT(a, b) ON_SCOPE_EXIT_XCONCAT(a, b)+#define ON_SCOPE_EXIT_XCONCAT(a, b) a##b+#define ON_SCOPE_EXIT(func) \

I think we should have an explicit object and not use a macro. I.e. in the main.cpp:

on_scope_exit free_realtive_sd{[&]{ LocalFree(self_relative_sd); });
yuyoyuppe

comment created time in a month

Pull request review commentmicrosoft/PowerToys

FancyZones: add approved apps list and unify window filtering

 LRESULT CALLBACK FancyZones::s_WndProc(HWND window, UINT message, WPARAM wparam,         DefWindowProc(window, message, wparam, lparam);
 }
 
-void FancyZones::UpdateZoneWindows() noexcept
+bool FancyZones::IsWindowInteresting(HWND hwnd)
 {
-    auto callback = [](HMONITOR monitor, HDC, RECT *, LPARAM data) -> BOOL
+    // Get general window ifo
+    auto windowInfo = get_filtered_window_info(hwnd);

Before get_filtered_window would just say if the window should be filtered and return the path to the executable. Now it provides some more information. Some of the windows (Start menu, taskbar, buttons) are filtered like before, but for the rest of the windows, we also get information if the window has an owner and if it is a "standard" window (none of the WS_DISABLED, WS_EX_TOOLWINDOW nor WS_EX_NOACTIVATE styles set).

Normally, we return true only for standard windows without an owner. But if the app is in the approved apps list, we also return true here.

bzoz

comment created time in a month

push eventbzoz/PowerToys

Bartosz Sosnowski

commit sha 1d2b4f079898eb27a6ff8cc117b08c6b44e854c5

fixup: style, always test for WS_CHILD, add explicit flag

view details

Bartosz Sosnowski

commit sha 1b7c4f98a9c4e6da5696a6d9063308af9df13815

fixup: comments

view details

push time in a month

Pull request review commentmicrosoft/PowerToys

FancyZones: add apps whitelist and unify window filtering

 IFACEMETHODIMP_(void) FancyZones::Destroy() noexcept // IFancyZonesCallback
 IFACEMETHODIMP_(void) FancyZones::MoveSizeStart(HWND window, HMONITOR monitor, POINT const& ptScreen) noexcept
 {
-    std::unique_lock writeLock(m_lock);
-    MoveSizeStartInternal(window, monitor, ptScreen, writeLock);
+    if (IsWindowInteresting(window))

We filter the windows here instead of dllmain.cpp

bzoz

comment created time in a month

Pull request review commentmicrosoft/PowerToys

FancyZones: add apps whitelist and unify window filtering

 void FancyZonesModule::HandleWinHookEvent(WinHookEvent* data) noexcept 
 void FancyZonesModule::MoveSizeStart(HWND window, POINT const& ptScreen) noexcept
 {
-    if (IsInterestingWindow(window))
+    if (auto monitor = MonitorFromPoint(ptScreen, MONITOR_DEFAULTTONULL))

Instead of doing the IsInterestingWindow check here, we do it in the lib/FancyZones.cpp

bzoz

comment created time in a month

Pull request review commentmicrosoft/PowerToys

FancyZones: add apps whitelist and unify window filtering

 class FancyZonesModule : public PowertoyModuleIface     }
 
 private:
-    bool IsInterestingWindow(HWND window)

This was moved to lib/FancyZones.cpp

bzoz

comment created time in a month

push eventmicrosoft/PowerToys

Bartosz Sosnowski

commit sha cc99abcd144cd444d5843118e254a39292594729

Runner: fix restarting with same elevation (#1133)

view details

push time in a month

PR merged microsoft/PowerToys

Runner: fix restarting with same elevation

<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->

Summary of the Pull Request

Fixes restarting with the same elevation when installed from MSIX

<!-- Please review the items on the PR checklist before submitting-->

PR Checklist

  • [x] Applies to #1132
  • [x] CLA signed.

Validation Steps Performed

Manual

+3 -3

0 comment

2 changed files

bzoz

pr closed time in a month

pull request commentmicrosoft/PowerToys

FancyZones: add apps whitelist and unify window filtering

Updated and solved merge conflict, PTAL.

bzoz

comment created time in a month

push eventbzoz/PowerToys

Bartosz Sosnowski

commit sha da14a49d3f9511874961ae9130aa2c5cfedba222

FancyZones: add approved apps list and unify window filtering Add a "approved apps" settings, similar to the "excluded apps" one. If an app is on this list, more of the apps window will be zonable. Unifies the code that decides if a window is zonable. Before this, WinKey + Arrows used different code than dragging the window.

view details

push time in a month

push eventbzoz/PowerToys

Alekhya

commit sha 1ad16ade868a2b28390a848613c4af5a47f6a92b

Localize the Shortcut guide PowerToy (#199) (#1126) * Localized shortcut_guide.cpp * localized overlay_window.cpp * formatting changes * Localize overlay window * removed the README link from the set of localized resources * Typo: changed upper to lower

view details

Alekhya

commit sha 925b6694ac08efe5e2dc87db439f97c6201ddf17

Localize C++ Projects of FancyZones (#1130) * localized dllmain.cpp of fancyzones project * localized FancyZones.cpp * format fancyzones.rc file * Moved SuperFancyZones back to being a string instead of having it in the resource file as it is the window class name * reverted changes for window name * Formatted fancyzones rc file

view details

vldmr11080

commit sha 1a10366ab75e421b26d973ea804aa70f826b381e

Align zone dimensions from layout preview with those from grid editor (#1115)

view details

Bartosz Sosnowski

commit sha 27e6aa6c514674ec134a978fb7802387afbe38f2

FancyZones: add apps whitelist and unify window filtering Add a "whitelist" settings, similar to the "excluded apps" one. If an app is on this list, more of the apps window will be zonable. Unifies the code that decides if a window is zonable. Before this, WinKey + Arrows used different code than dragging the window.

view details

push time in a month

issue commentmicrosoft/PowerToys

Runner: MSIX installed PT cannot restart as admin

From a elevated command prompt (admin user does not have PT installed):

  • The PT folder in the WindowsApps folder exists
  • The .exe cannot be run - fails with Access denied in the conosle.
bzoz

comment created time in a month

issue commentmicrosoft/PowerToys

Runner: MSIX installed PT cannot restart as admin

This also happens when trying to run PTs as Admin from the Start menu.

bzoz

comment created time in a month

issue commentmicrosoft/PowerToys

Runner: MSIX installed PT cannot restart as admin

This happens when the admin user does not have PT installed. When PT are installed, settings screen fails to load: image

bzoz

comment created time in a month

issue openedmicrosoft/PowerToys

Runner: MSIX installed PT cannot restart as admin

Environment

PowerToys version: master

Steps to reproduce

  • have PT installed through MSIX as an non-admin user
  • use "restart as admin" or have "always run as admin" on and restart PTs
  • enter the correct admin password

Expected behavior

  • PT runs as admin

Actual behavior

  • PT fails to run

Screenshots

image

created time in a month

PR opened microsoft/PowerToys

FancyZones: add apps whitelist and unify window filtering

Summary of the Pull Request

Add a "whitelist" settings, similar to the "excluded apps" one. If an app is on this list, more of the apps window will be zonable.

Unifies the code that decides if a window is zonable. Before this, WinKey + Arrows used different code than dragging the window.

PR Checklist

  • [x] Applies to #894 (SUMo and XYplorer) #1104
  • [x] CLA signed.

Validation Steps Performed

Manual.

+124 -137

0 comment

10 changed files

pr created time in a month

PR opened microsoft/PowerToys

Reviewers
Runner: fix restarting with same elevation

<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->

Summary of the Pull Request

Fixes restarting with the same elevation when installed from MSIX

<!-- Please review the items on the PR checklist before submitting-->

PR Checklist

  • [x] Applies to #1132
  • [x] CLA signed.

Validation Steps Performed

Manual

+3 -3

0 comment

2 changed files

pr created time in a month

create barnchbzoz/PowerToys

branch : fix-unelevated-restart

created branch time in a month

issue openedmicrosoft/PowerToys

Runner: non-admin MSIX installation stuck in restart loop

PowerToys version: current master

Steps to reproduce

  • install through MSIX on a non-admin account
  • Set "Run at logon" and "Run as admin"

Expected behavior

  • after failed elevation PT start non-elevated

Actual behavior

  • PT keep requesting for elevation

created time in a month

issue commentmicrosoft/PowerToys

Install without Admin Rights?

MSIX built by current master can be installed by non-admin users.

LtCmdrKeene

comment created time in a month

create barnchbzoz/PowerToys

branch : fancyzones-whitelist-rb

created branch time in a month

issue commentmicrosoft/PowerToys

Window resizing on Fancy Zones

I don't really have an idea how this could be implemented. There is no per-app DPI in Windows, and I don't think there is universal way to zoom in/out apps.

LucioMenci

comment created time in a month

issue commentmicrosoft/PowerToys

Windows notifications snap to FancyZones

It does not reproduce with the current master.

matthewdias

comment created time in a month

push eventbzoz/PowerToys

Alekhya Kommuru

commit sha 969abe015c37b76321b7a21344a835d52c89e621

added the helper functions

view details

Alekhya Kommuru

commit sha 0b1232b65d9b345bebd10df7e3699497ecf8ea79

localized dllmain powerrename

view details

Alekhya Kommuru

commit sha 8f2b2aba1250e3a68f4b2c919d2068f8e83b9ac1

localized powerRenameExt

view details

Alekhya Kommuru

commit sha 1e3486af94ea78ad0c2c5c6821d15c886740b171

localized the settings file

view details

Alekhya Kommuru

commit sha d0648d17540b12088f00cb24e5f07322c264b930

built the proj

view details

Alekhya Kommuru

commit sha 31a01ab22722323ac65bd7087f113b07557fda24

Modified resourceIDs for strings in the table

view details

Alekhya Kommuru

commit sha 12c4dbf0e5d2f9f49fd6022dad6d02e1b727612f

added common as a reference project

view details

Alekhya Kommuru

commit sha bde0e0b86a07c71a23869d522040e916ac90814d

Merge remote-tracking branch 'upstream/master' into locPowerRename

view details

Alekhya Kommuru

commit sha df1c6b9b0b80380aa8141fe2be247aa1779ec2bd

Removed get_res_string_wchar and used the get_resource_string() function instead which returns a wstring typecast into wchar*

view details

Alekhya Kommuru

commit sha 44ac22c0ded6ada4c7a749b17f6ad8d1640104ca

Added new lines to the end of the file

view details

Alekhya Kommuru

commit sha a504a75166a7a8d50f33885e39a07d6f3f94870a

Removed string resources from the settings.cpp file

view details

Alekhya Kommuru

commit sha bf487293541fbdcfb5a05c74afe211d3e578a835

rebuilt project PowerRename

view details

Alekhya Kommuru

commit sha 197286c21e923e3b962a76c83d73fe72c560f637

moved app name to constructor to init only once

view details

Alekhya Kommuru

commit sha 8132bbac2eac25a7d460ee32bd03bc36a35d8ea7

updated formatting of common.cpp

view details

Alekhya Kommuru

commit sha 653a84d3a990106c72d5f20f973b846d4919aaf3

reverting formatting of files

view details

Bartosz Sosnowski

commit sha 62da7c7be450216b7f442f0eac651d4b2a46f327

FancyZones: remove dialog boxes filtering (#1076) * FancyZones: remove dialog boxes filtering * FancyZones: add the "no owner window" filter to the WinKey + arrow zone snapping

view details

Alekhya Kommuru

commit sha 9c743acd2d88a0832bd6602fd2fd4c0c7625ae49

Removed some IDs from resource file. Changed SHIFT to Shift

view details

Alekhya Kommuru

commit sha 23bba969dd0a61ce508b7b0e65f18c7a30a11ad7

Merge remote-tracking branch 'upstream/master' into locPowerRename

view details

Alekhya

commit sha ba1a681aab6eaa877db93797ba6e45ebf700505c

Merge pull request #1106 from alekhyareddy28/locPowerRename Localize PowerRename

view details

Bartosz Sosnowski

commit sha 606fb9f949c4b2eefcf6df215578292ffb621df5

WIP

view details

push time in a month

create barnchbzoz/PowerToys

branch : fancyzones-whitelist

created branch time in a month

Pull request review commentstefansjfw/PowerToys

Json migration

 #include "RegistryHelpers.h"  #include <ShellScalingApi.h>+#include <mutex>++namespace {+  enum class TTmpFileType {+    EActiveZoneSetFile = 0,+    EAppliedZoneSetFile,+    ECustomZoneSetsFile+  };++  std::wstring GenerateTmpFileName(TTmpFileType type)+  {+    static std::wstring activeZoneSetTmpFileName;+    static std::wstring appliedZoneSetTmpFileName;+    static std::wstring customZoneSetsTmpFileName;+    static std::once_flag f1, f2, f3;++    std::call_once(f1, []() {

We should put string initialization next to their declaration. The f1 etc. should be named more meaningful.

stefansjfw

comment created time in a month

Pull request review commentstefansjfw/PowerToys

Json migration

+#include "pch.h"+#include "JsonHelpers.h"+#include "RegistryHelpers.h"+#include "ZoneSet.h"++#include <shlwapi.h>+#include <filesystem>+#include <fstream>+#include <regex>++namespace+{+    struct Monitors+    {+        HMONITOR* data;+        int count;+    };++    BOOL CALLBACK MyInfoEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData)+    {+        Monitors* monitors = reinterpret_cast<Monitors*>(dwData);+        monitors->data[monitors->count++] = hMonitor;+        return true;+    }++    // From Settings.cs+    constexpr int c_focusModelId = 0xFFFF;+    constexpr int c_rowsModelId = 0xFFFE;+    constexpr int c_columnsModelId = 0xFFFD;+    constexpr int c_gridModelId = 0xFFFC;+    constexpr int c_priorityGridModelId = 0xFFFB;+    constexpr int c_blankCustomModelId = 0xFFFA;++}++namespace JSONHelpers+{+    json::JsonArray NumVecToJsonArray(const std::vector<int>& vec)+    {+        json::JsonArray arr;+        for (const auto& val : vec)+        {+            arr.Append(json::JsonValue::CreateNumberValue(val));+        }++        return arr;+    }++    std::vector<int> JsonArrayToNumVec(const json::JsonArray& arr)+    {+        std::vector<int> vec;+        for (const auto& val : arr)+        {+            vec.emplace_back(val.GetNumber());+        }++        return vec;+    }++    int TypeToLayoutId(JSONHelpers::ZoneSetLayoutType layoutType)+    {+        switch (layoutType)+        {+        case ZoneSetLayoutType::Focus:+            return c_focusModelId;+        case ZoneSetLayoutType::Columns:+            return c_columnsModelId;+        case ZoneSetLayoutType::Rows:+            return c_rowsModelId;+        case ZoneSetLayoutType::Grid:+            return c_gridModelId;+        case ZoneSetLayoutType::PriorityGrid:+            return c_priorityGridModelId;+        case ZoneSetLayoutType::Custom:+            return 0;+        }+        return -1; // Error+    }++    ZoneSetLayoutType TypeFromLayoutId(int layoutID)+    {+        switch (layoutID)+        {+        case c_focusModelId:+            return ZoneSetLayoutType::Focus;+        case c_columnsModelId:+            return ZoneSetLayoutType::Columns;+        case c_rowsModelId:+            return ZoneSetLayoutType::Rows;+        case c_gridModelId:+            return ZoneSetLayoutType::Grid;+        case c_priorityGridModelId:+            return ZoneSetLayoutType::PriorityGrid;+        default:+            return ZoneSetLayoutType::Custom;+        }+    }++    std::wstring TypeToString(ZoneSetLayoutType type)+    {+        switch (type)+        {+        case ZoneSetLayoutType::Focus:+            return L"focus";+        case ZoneSetLayoutType::Columns:+            return L"columns";+        case ZoneSetLayoutType::Rows:+            return L"rows";+        case ZoneSetLayoutType::Grid:+            return L"grid";+        case ZoneSetLayoutType::PriorityGrid:+            return L"priority-grid";+        case ZoneSetLayoutType::Custom:+            return L"custom";+        default:+            return L"TypeToString_ERROR";+        }+    }++    ZoneSetLayoutType TypeFromString(const std::wstring& typeStr)+    {+        if (typeStr.compare(L"focus") == 0)+        {+            return JSONHelpers::ZoneSetLayoutType::Focus;+        }+        else if (typeStr.compare(L"columns") == 0)+        {+            return JSONHelpers::ZoneSetLayoutType::Columns;+        }+        else if (typeStr.compare(L"rows") == 0)+        {+            return JSONHelpers::ZoneSetLayoutType::Rows;+        }+        else if (typeStr.compare(L"grid") == 0)+        {+            return JSONHelpers::ZoneSetLayoutType::Grid;+        }+        else if (typeStr.compare(L"priority-grid") == 0)+        {+            return JSONHelpers::ZoneSetLayoutType::PriorityGrid;+        }+        else+        { //Custom+            return JSONHelpers::ZoneSetLayoutType::Custom;+        }+    }++    FancyZonesData& FancyZonesDataInstance()+    {+        static FancyZonesData instance;+        return instance;+    }++    FancyZonesData::FancyZonesData()+    {+        std::wstring result = PTSettingsHelper::get_module_save_folder_location(L"FancyZones");+        jsonFilePath = result + L"\\" + std::wstring(FANCY_ZONES_DATA_FILE);+    }++    const std::wstring& FancyZonesData::GetPersistFancyZonesJSONPath() const+    {+        return jsonFilePath;+    }++    json::JsonObject FancyZonesData::GetPersistFancyZonesJSON()+    {+        std::wstring save_file_path = GetPersistFancyZonesJSONPath();++        auto result = json::from_file(save_file_path);+        if (result)+        {+            return *result;+        }+        else+        {+            return json::JsonObject();+        }+    }++    int FancyZonesData::GetAppLastZone(HWND window, PCWSTR appPath) const+    {+        int iZoneIndex = -1;++        if (auto monitor = MonitorFromWindow(window, MONITOR_DEFAULTTONULL))+        {+            TAppPath path{ appPath };+            if (appZoneHistoryMap.contains(path))+            {+                iZoneIndex = appZoneHistoryMap.at(path).zoneIndex;+            }+        }+        return iZoneIndex;+    }++    // Pass -1 for the zoneIndex to delete the entry from the map

Can we have a separate function for deleting entries?

stefansjfw

comment created time in a month

more