It is currently August 9th, 2020, 8:14 am

Searching for a plugin.

Help with creating, editing & fixing problems with skins
dvo
Posts: 853
Joined: February 7th, 2016, 6:08 am

Re: Searching for a plugin.

Post by dvo »

nice work JsMorley :17good
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Searching for a plugin.

Post by kyriakos876 »

jsmorley wrote:Cool.

Yeah, this is a very specific, one-off kind of plugin, as it is so seldom that any given single pixel gives you much confidence about what the "color" of something is.

If we zoom in 3200% on this N that has a color of #4040FF, we can see how that visible color is actually constructed in the context of a complex shape like a font letter on a particular background color.

2.png
I've noticed that too, but in my case the "targeted" pixel is in the midle of the circle which is the same color and there is no anti-alias stuff going on. :)
User avatar
raiguard
Posts: 664
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: Searching for a plugin.

Post by raiguard »

I have a slight problem... this plugin is causing some massive lag on my PC when invoked. Here's a GIF to demonstrate:
LAGGGGGGG.gif
(For reference, usually the dragging is almost lagless, with just a little bit of a hiccup when Disks Meter updates).

There are two skins at play here: The 'control' skin, which consists of a 1-pixel dot in each corner of the monitor's work area, and another, which is a simple image meter with the FrostedGlass plugin (I am aware of the issues this plugin causes, but this lag happens even if I disable the plugin).

The idea is that I have a reserved column where I can keep my gadgets, and they will always remain visible. Whenever a window is maximized, a translucent background is added to fill the empty space, greatly enhancing the aesthetics.

This works by using the PixelColor plugin to check the color of each corner pixel. If it is equal to the color of the dot, then it returns 0. If the color is different from what it should be (which means that a window is covering it), then it returns 1. This is used to determine whether or not a window is maximized. It is very similar to the method adopted by Adaptive Translucent Taskbar skin.

Here is the code for the "control" skin:

Code: Select all

[Rainmeter]
MiddleMouseUpAction=[!Refresh]
OnRefreshAction=[!ZPos -2][!ClickThrough 1][!AutoSelectScreen 1][!Move "[#WORKAREAX@[#sb1Monitor]]" "[#WORKAREAY@[#sb1Monitor]]"]
OnCloseAction=[!CommandMeasure MeasureLoadSkinScript "ToggleSkin('[MeasureSb1BgConfig]', nil, 0)"]
AccurateText=1
DynamicWindowSize=1
Group=ModernGadgets | MgImportRefresh | MgSb1

[Variables]
@includeStyleSheet=#@#StyleSheet.inc
@includeGlobalSettings=#@#Settings\GlobalSettings.inc

state=1

; ==================================================
;  MEASURES
; ==================================================

[MeasurePixelColor]
Measure=Plugin
Plugin=PixelColor

[MeasureConfigActive]
Measure=Plugin
Plugin=ConfigActive

[MeasureLoadSkinScript]
Measure=Script
ScriptFile=#scriptPath#LoadSkin.lua

[MeasureVerifyScript]
Measure=Script
ScriptFile=#scriptPath#Verify.lua

[MeasureSb1BgConfig]
Measure=String
String=ModernGadgets\Settings\Sidebars\Backgrounds\1
Substitute="\":"\\"

[MeasureWorkAreaWidth]
Measure=Calc
Formula=(#WORKAREAX# + #WORKAREAWIDTH# - 1)
DynamicVariables=1

[MeasureWorkAreaHeight]
Measure=Calc
Formula=(#WORKAREAY# + #WORKAREAHEIGHT# - 1)
DynamicVariables=1

[MeasureDirectionControl]
Measure=String
String=#sb1Alignment#
IfMatch=right
IfMatchAction=[!EnableMeasure MeasureControlRight]
IfNotMatchAction=[!EnableMeasure MeasureControlLeft]

[MeasureControlRight]
Measure=Calc
Formula=([&MeasureVerifyScript:CheckColor('[&MeasurePixelColor:PixelRGB([&MeasureWorkAreaWidth:],[#WORKAREAY])]')] <> #state#) + ([&MeasureVerifyScript:CheckColor('[&MeasurePixelColor:PixelRGB([&MeasureWorkAreaWidth:],[&MeasureWorkAreaHeight:])]')] <> #state#)
DynamicVariables=1
IfCondition=MeasureControlRight = 2
IfTrueAction=[!SetVariable state "(abs(#state#-1))"][!EnableMeasure MeasureToggleBackground][!UpdateMeasure MeasureToggleBackground][!UpdateMeasure MeasureControlRight]
Disabled=1

[MeasureControlLeft]
Measure=Calc
Formula=([&MeasureVerifyScript:CheckColor('[&MeasurePixelColor:PixelRGB([#WORKAREAX],[#WORKAREAY])]')] <> #state#) + ([&MeasureVerifyScript:CheckColor('[&MeasurePixelColor:PixelRGB([#WORKAREAX],[&MeasureWorkAreaHeight:])]')] <> #state#)
DynamicVariables=1
IfCondition=MeasureControlLeft = 2
IfTrueAction=[!SetVariable state "(abs(#state#-1))"][!EnableMeasure MeasureToggleBackground][!UpdateMeasure MeasureToggleBackground][!UpdateMeasure MeasureControlLeft]
Disabled=1

[MeasureToggleBackground]
Measure=Calc
IfCondition=#state# = 1
IfTrueAction=[!CommandMeasure MeasureLoadSkinScript "ToggleSkin('[MeasureSb1BgConfig]', nil, 1)"][!DisableMeasure MeasureToggleBackground]
IfFalseAction=[!CommandMeasure MeasureLoadSkinScript "ToggleSkin('[MeasureSb1BgConfig]', nil, 0)"][!DisableMeasure MeasureToggleBackground]
DynamicVariables=1
Disabled=1

; ==================================================
;  METERS
; ==================================================

[MeterTopLeft]
Meter=Image
SolidColor=#colorSbControlCorner#
X=0
Y=0
W=1
H=1

[MeterTopRight]
Meter=Image
SolidColor=#colorSbControlCorner#
X=(#WORKAREAWIDTH# - 1)
Y=0
W=1
H=1
DynamicVariables=1

[MeterBottomLeft]
Meter=Image
SolidColor=#colorSbControlCorner#
X=0
Y=(#WORKAREAHEIGHT# - 1)
W=1
H=1
DynamicVariables=1

[MeterBottomRight]
Meter=Image
SolidColor=#colorSbControlCorner#
X=(#WORKAREAWIDTH# - 1)
Y=(#WORKAREAHEIGHT# - 1)
W=1
H=1
DynamicVariables=1

; [MeterDebugDragger]
; Meter=Image
; SolidColor=0,100,0
; X=10
; Y=10
; W=30
; H=30
(This skin is very heavily integrated into my ModernGadgets suite, so trying to run it standalone will not work. You can download the most recent beta release here. Go into the global settings skin and click the 'Enable Sidebar 1' button, then click 'Update Work Area' to set it up, if all goes well...)

Is this an issue with the plugin, or am I just using it extremely inefficiently somehow?
You do not have the required permissions to view the files attached to this post.
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Searching for a plugin.

Post by kyriakos876 »

I've been using the plugin for 6 months and never have I seen any lag related to it... Are you sure it's not lagging because you have something full screen? Try invoking it with 2 small Windows on each dot. Also, check that task manager while dragging it to see what is the bottleneck.
User avatar
raiguard
Posts: 664
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: Searching for a plugin.

Post by raiguard »

kyriakos876 wrote:
November 1st, 2018, 11:04 am
I've been using the plugin for 6 months and never have I seen any lag related to it... Are you sure it's not lagging because you have something full screen? Try invoking it with 2 small Windows on each dot. Also, check that task manager while dragging it to see what is the bottleneck.
It's not lagging because something is fullscreen, it is a constant thing. I reinstalled ATT and it exhibits the same behavior... something must be going on with my PC specifically or something?

Edit: Could it have to do with the fact that I have three monitors, two of which are 1440p and one is 1080p?
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4069
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Searching for a plugin.

Post by eclectic-tech »

raiguard wrote:
November 2nd, 2018, 2:03 am
It's not lagging because something is fullscreen, it is a constant thing. I reinstalled ATT and it exhibits the same behavior... something must be going on with my PC specifically or something?

Edit: Could it have to do with the fact that I have three monitors, two of which are 1440p and one is 1080p?
Have you checked to make sure Rainmeter is NOT in Debug Mode? :???:
I use that setting to test new skins, but it can cause performance issues if left active. :confused:
User avatar
raiguard
Posts: 664
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: Searching for a plugin.

Post by raiguard »

eclectic-tech wrote:
November 2nd, 2018, 3:40 am
Have you checked to make sure Rainmeter is NOT in Debug Mode? :???:
I use that setting to test new skins, but it can cause performance issues if left active. :confused:
Yeah, Rainmeter is not in debug mode either. I also tested with my secondary monitors deactivated, and the lag still exists. :(
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017
User avatar
raiguard
Posts: 664
Joined: June 25th, 2015, 7:02 pm
Location: The Sky, USA

Re: Searching for a plugin.

Post by raiguard »

So the lagging is not the only problem I'm having with this plugin...

This plugin completely breaks Windows.

Here is a video of the bug in action (had to record with my phone, for reasons that will become obvious as soon as you watch it...)

This problem occurs, as far as I can tell, when you switch users while this plugin is running, and stay there for a great length of time. I included reproduction steps below, but they are not consistent and will only trigger the issue very infrequently.

As you can see in the video, the plugin completely bugs out explorer. The positioning of everything gets completely screwed up, and Windows becomes completely unusable. If you manage to click on Rainmeter in task manager and end the process, everything returns to normal. In the video as well, you can see that my other skins suddenly re-appear, and the issue mostly resolves itself. I do not know why or how it did this, maybe it has to do with a span of time?

All the while, the PixelColor plugin is incessantly spitting the following two lines to the Rainmeter log:

Code: Select all

WARN (14:01:05.039) ModernGadgets\Settings\Sidebars\Control\2\Sb2Control.ini - [MeasurePixelColor]: CursorColor: Error getting pixel color
ERRO (14:01:05.040) ModernGadgets\Settings\Sidebars\Control\2\Sb2Control.ini - [MeasurePixelColor]: Invalid return type in function: PixelRGB
I have not yet been able to reproduce this while running Rainmeter in debug mode, but I am working on it.

To try and reproduce this yourself, follow these steps:

1. Download ModernGadgets 1.5.0-beta.2
2. Go into the global settings skin (ModernGadgets\Settings\GlobalSettings) and click "enable sidebar 1". Adjust the settings to create a sidebar somewhere on your desktop, then click 'Update Work Area'. When you maximize a window it should look something like this:
2018-11-13 13_57_07-.png
3. Lock the user (with or without a window maximized, it doesn't matter) and log into another user
4. Load some Rainmeter skins (in my specific case, my brother has ModernGadgets 1.4.1 loaded, with all six gadgets in use)
5. Wait for a while (upwards of 5 minutes?)
6. Lock the second user, log back into the first

This method will SOMETIMES cause the issue to occur on my PC, but not every time.
You do not have the required permissions to view the files attached to this post.
”We are pretty sure that r2922 resolves the regression in resolution caused by a reversion to a revision.” - jsmorley, 2017