Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

[PATCH] bw's EventGhost library changes

Found a bug in EventGhost? Report it here.
Post Reply
User avatar
blackwind
Experienced User
Posts: 182
Joined: Wed Sep 12, 2012 2:59 am
Location: Canada
Contact:

[PATCH] bw's EventGhost library changes

Post by blackwind »

To replace my previous hotkey managers, I had to add a number of features to EventGhost. Seems the quickest way to get one's changes merged is to create a bug report with a patch, so that's what I'm doing here.

In the attached patch, you'll find the following changes:

eg.WinApi.Utils:
  • Added GetAlwaysOnTop(), which returns the specified window's "always on top" property.
  • Added GetBestHwnd(), which returns either the specified hwnd, eg.lastFoundWindows[0], or the foreground window.
  • Added GetContainingMonitor(), which returns a wx.Rect describing the monitor on which the specified window is contained.
  • Added GetWindowDimensions(), which returns a wx.Rect for use with GetContainingMonitor().
eg.plugins.EventGhost:
  • Added "Dump Result to Log", which dumps eg.result to the EventGhost log for debugging purposes. During the configuration process, I was shocked to learn that, short of writing a Python script, there was no existing mechanism for doing this.
eg.plugins.Winamp:
  • Added "Change Repeat Track Status", which sets, clears, or toggles the status of its namesake AND returns the new value. "Change Repeat Status" and "Change Shuffle Status" have been modified to do the same.
  • Added "Get Repeat Track Status", which gets the status of Repeat Track.
  • Added "Jump to File", which opens and focuses the "Jump to File" window.
  • Added "Stop After Current", which stops playback after the current track.
  • Added "Toggle Always on Top", which toggles "always on top". Regrettably, Winamp doesn't offer the ability to set this property -- only toggle it.
  • Modified "Get Currently Playing Song Title" to return the correct result when "General Preferences > Show the playlist number in the Windows taskbar" is disabled in Winamp.
eg.plugins.Window:
  • Added "Dock Window", which moves the specified window to the specified edge(s) of your screen.
  • Added "Minimize to Tray", which -- you guessed it -- minimizes the specified window to the system tray.
  • Using GetAlwaysOnTop(), "Set always on top property" now returns its result after execution.
In addition, I've corrected a few wordings and spelling mistakes. I hope all this is valuable to you fine folks, and I hope to see it included in the next version of EventGhost!

P.S.: I'm really, really, REALLY looking forward to a fix for this bug. Of all my bug reports and feature requests to date, that one's the only true deal-breaker. Until it's resolved, I won't be able to use EventGhost full-time, and I probably won't be contributing any further code as a result.
Attachments
patch.zip
(22.35 KiB) Downloaded 297 times
Last edited by blackwind on Sun Sep 30, 2012 9:20 am, edited 1 time in total.
/bw
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: [PATCH] bw's EventGhost library changes

Post by Pako »

I will explore your modifications and they are likely to be incorporated into the next release.
However, I can not understand why you used "Bug Reports" section.
More appropriate would have been some in the "Feature Requests" or "Coding Corner".

Pako
User avatar
blackwind
Experienced User
Posts: 182
Joined: Wed Sep 12, 2012 2:59 am
Location: Canada
Contact:

Re: [PATCH] bw's EventGhost library changes

Post by blackwind »

Pako wrote:I will explore your modifications and they are likely to be incorporated into the next release.
Thanks, Pako. :)

A quick update for you: I just fixed an important bug in "Minimize to Tray", and I've uploaded a replacement patch. Only the MinimizeToTray class in Window/__init__.py has been altered.
Pako wrote:However, I can not understand why you used "Bug Reports" section.
More appropriate would have been some in the "Feature Requests" or "Coding Corner".
I wasn't posing a question, so Coding Corner wasn't the right place, and I've seen very, very little developer activity in the Feature Requests forum here, so I figured it might be wise to submit my work elsewhere, lest it fall on deaf ears. Since most open source projects accept patches via their bug trackers, the Bug Reports forum, while not a perfect match, seemed like the best fit to me at the time.
/bw
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: [PATCH] bw's EventGhost library changes

Post by Pako »

=> 0.4.1.r1600
User avatar
blackwind
Experienced User
Posts: 182
Joined: Wed Sep 12, 2012 2:59 am
Location: Canada
Contact:

Re: [PATCH] bw's EventGhost library changes

Post by blackwind »

"Minimize to Tray" was broken in the following ways:
  • Only the most recently created icon could be restored.
  • Icons for terminated processes couldn't be removed.
  • Icons could be created for processes without visible windows.
No longer. See the attached patch.
Attachments
patch.zip
(7.15 KiB) Downloaded 235 times
/bw
Post Reply