Avalonia : Multiscreen - opening a window with negative x-value (on left monitor) fails to work - avaloniaui

Situation : Avalonia 0.10.18, Windows 11, 3 (same) monitors, NET6.0.
I have a 'main' window on the middle screen and I use a second (floating) window for some common values (with 'main' as parent). I save the position of the second 'floating' window on closing and on 'OnOpened' I read the values and position the window accordingly. That works fine as long as the floating window was not on the left monitor (negative X-value)(so all X-positions on middle and right work fine).
Since this second window has the main window as parent, the X-value is thus negative and I presume that is to prevent windows from being out of the screen area.
A last fact, but I doubt that that has to do with it, is that I'm using windowless windows, but the custom made positioning works correct in all cases (even on the left monitor).
Since in absolute values my 'floating' window is not out of the screen area and I do not know if I'm perhaps using a wrong event or is this rather a bug ?

OK, Sorry, my bad. I had in an upper class window a rule set that if the left < 0, not to use that value at the startup of the window.
So, it was a bug in my code and not in the Avalonia code !

Related

java 3d with two monitors

I'm working on an application using Java 3D on Windows. It works fine until the window (i.e frame) is moved to another screen/monitor. Then it starts behaving not normally even when I move it back to the first monitor.
The symptom is that the view disappears and reappears from time to time when resizing or moving the window. I only see the panel underneath then. It does not reappear until I click on it or resize or move the window.
Any idea why?
Thanks
I'm using java 3d 1.5, but the problem exists also in 1.6.

Custom NSWindows

Is is possible to make a window act like a true heads up display? If not fully can a windows do any part of the following? Any pointers on finding information about how to code a window like this would be great.
1 - Be above everything?
All other windows?
On all spaces?
Shown above the screensaver? [1]
2 - Be non interactive?
Never get focus?
Ignore all mouse clicks? (ie. if the user click where the window is, what ever is under the window receives the click)
[1] Shown above the screen saver would be a user settable preference (default to off). If the display is a big TV and the screen saver slide show is running, the user may sill want the display to be shown.
I'm not sure what you want. If you're looking for a full screen app here's Implementing the Full-Screen Experience.
Otherwise, you might be wanting to read Window Layers and Levels
Here's an exert for convenience:
There are a number of predefined window levels, specified by constants defined by the NSWindow class. The levels you typically use are: NSNormalWindowLevel, which specifies the default level; NSFloatingWindowLevel, which specifies the level for floating palettes; and NSScreenSaverWindowLevel, which specifies the level for a screen saver window. You might also use NSStatusWindowLevel for a status window, or NSModalPanelWindowLevel for a modal panel. If you need to implement your own popup menus you use NSPopUpMenuWindowLevel. The remaining two levels, NSTornOffMenuWindowLevel and NSMainMenuWindowLevel, are reserved for system use.
Oh! And I'm pretty sure you can't have anything over the screensaver.

Controls change place and form size changes

I have designed a form in VB.NET. At design time I have placed two buttons on it.
When I run it, the form size looks smaller and the buttons I have placed at the bottom are not visible. Also the alignment of the text and picture box is also different from what I set at design time.
Computer at which I am running the form is using a different resolution.
change the properties (F4) of the buttons: in ANCHOR put Bottom, Right
your buttons will be tied to the bottom and the right of the screen, instead of to the top, left, which is the default.
Grab the screen size at runtime with
Dim screen as System.Windows.Forms.Screen = System.Windows.Forms.Screen.PrimaryScreen
and using a scale factor depending on the current size (in design), scale the window to match. Check the coordinates of the buttons by hand to make sure they are not outside of the visible portion of the window.
You may not have to leave this feature in if you can debug it to the point that you know the exact resolution that you need.

How to Host Apple's Pitch Shift Audio Unit plugin and the like

How do you host the PitchShift Audio Unit plugin correctly in its own window?
I am developing a Mac app that hosts Apple's system supplied Audio Unit plugins. With the new OSX 10.7 Lion, some of the plugins have updated views. PitchShift is one of these.
PitchShift and a few others have new knobs to change there parameters. When a knob is being turned with the mouse, a horizontal bar showing the knob's parameter value is displayed below the knob.
This bar stays on screen after the knob is released and even after the window is closed. If I click one of the knobs, thus creating a rogue value bar, and move the window the PitchShift view is in, the bar stays where the window used to be. And if I click the knob again at this point, a new bar appears, but both bars are actively updated with the changing knob parameter value information. This happens every time I repeat this process with more bars staying on screen.
After a few times with this happening, my app exits with bad access at NSApplicaionMain() call in the main.m file.
I checked in Logic 9, and this does not happen there. The bar seems to be tied directly to the knob, and thus disappears immediately after you let the knob go with the mouse.
I set the PitchSHift view to be the contentView of a dedicated NSWindow.
How is Logic keeping this from happening, or just how can I?
I've tried seeing if the parameter value bars where subviews of the PitchShift view, but they don't seem to be.
Any help would be greatly appreciated.
EDIT: When the a value bar first appears, I get the following output in the console from my program: Circle and line do not intersect
So I've found that it is using core-animations CALayers. The problem now is that the value bar layers aren't a part of the PitchShiftView's layer hierarchy. In other words, I can find all the other layers that build up the pitchShiftView, but not the layers for the value bars. Which seems like it might be the whole problem to begin with.
I finally figured it out. The parameter value bars are child windows of the window that owns the audio unit view.
To solve the problem, I catch the mouse up events for the window in my subclass of NSApplication, and I then close the child window (aka the value bar) so that they don't stay on screen.
This did not stop the exit bad access. I now think that is a separate issue that only appeared to be related to these lingering child windows.

Possible bug in Interface Builder?

I've a window with a horizontal split view. On the bottom pane of the split view, I have a nssegmentedcontrol, aligned to the center. On the bottom of the nssegmentedcontrol I have 5 tabs that are controlled by the segmented control - click in one of the cells and the corresponding tab opens.
My problem is, if I completely minimize the bottom pane, to the point where the dividing line touches the bottom of the window, the segmented control gets pushed on top of the table header and never goes back to its original place.
I've tried fiddling with IB to get this to work, but no luck. Has anyone experienced this?
Following what's on the comments, I replaced the default split view with the one found in BWToolkit that allows for the definition of minimum and maximum height of each view.
BWTookit is a no go, the framework leakes a lot.
You should use RBSplitView (google it), it also gives you option for min and max height
and I started using it because of a bug in the split view as well, I used it for a chat window
but the split view didn't autosave as it should, every time it got like 2px smaller,
RBSplitView is great, and doesn't leak.