So I'm creating an application using SFML, which I want to be borderless, so no border style. I added the ability to move it around on the screen and am planning on adding the ability to scale the window, however, that made me realise there's just a bit more to this. When dragging any window (not mine) say to the top of the screen, windows kicks in and suggests the ability to scale it to full, or when you drag a window to the side of the screen windows, again, kicks in and suggests making it cover half your screen. And it does this on borderless applications like Google chrome, or Spotify as well. I could probably try and add this in myself, but it's obvious other applications dont implement it themselves as you can see windows actually doing it the way it visually shows it. So, how would I go ahead imlementing this? I'm using SFML 2.5.1 with C++.
I have tried looking through google and stackoverflow to see if anyone has had any similar issues, of which I couldn't find any, which could honestly have been me not knowing how exactly to phrase it.
Related
I think I understand the reasoning behind Wayland preventing windows from being manually positioned but there are a couple of instances in my Qt 5.15.2 application where I really need to have either some or absolute control over the position:
In the first instance the window is a pop-up. I'm using a QMainWindow so I can have it borderless with rounded corners, a coloured background and a transparency. I need it to pop-up when I hover over a certain element on my QGraphicsScene but want to ensure that when it appears it is close to the QGraphicsScene element in question but does not obscure it. Using a call to QMainWindow::move was perfect pre-Wayland and works fine on Windows too.
In the second instance my application has a number of windows which the user may open and close over time. The first time each one opens I don't care too much where it is positioned but if the user moves it before closing it then the next time the user opens it I want it to reappear where the user previously left it. Again, using the move() method of the various things that inherit from QWidget was perfect pre-Wayland.
Does anyone know of any work-arounds that would solve either of these problems under Qt on Wayland? It seems to me that neither is a particularly uncommon requirement and if Wayland won't let me set a specific position it might have a way of achieving something similar (e.g. a way of telling the compositor to position something near something else without obscuring it) and hopefully that maps onto something in the Qt API.
I have a Qt app that runs on macOS. I found a way to change the color of the titlebar here, however I want to take it a step further. I want to mimic the titlebar that the Slack and Discord apps use. For example:
As you can see, the color of the controls in the window extend to the very top of the app's window. I figure there are two ways to accomplish what I want:
I can build on the code pasted above. Looking through some of the Apple developer documentation, I think I can create a couple NsWindows on top of the titlebar with whatever width I want and attach the titlebar as a parent for those windows. Once I do that I should be able to make the same backgroundColor() color call for each one. Of course, this will require me to keep track of when the controls or window are resized and adjust the NsWindows of the titlebar, and I am not sure what (if any) issues that could cause.
Maybe there is a way to essentially set the height of the titlebar to 0? I wonder if that's what the Discord app is doing because:
if you look closely, the edit box that says "Find or start a conversation" is vertically lined with the close, minimize and maximize buttons, as is the "Activity" label. But if the controls do extend to the top of the app's window then how are the standard app buttons getting painted?
I'd be curious to know how Slack and Discord accomplish this even though I know they're not using Qt.
I realize there is not a Qt solution since Qt does not paint the titlebar. I know this will be OS-specific, but since I do not have any real experience with Objective-C++ or working with Cocoa (all of my programming experience on macOS has been standard C++ with non-UI or Qt-based code) I'd appreciate any suggestions or guidance!
Natively this is done with fullSizeContentView and titlebarAppearsTransparent properties of NSWindow. Once you set them to true, you can draw or place controls beneath the title bar.
I found a small program a while back that let me disable the Aero Blur while keeping the transparency that came with the theme. The program worked on literally everything, except for the taskbar which still appears to blur everything that happens to be underneath it.
This curious behavior led me to experimenting with the DWM api, in C++. Sadly, this didn't really help me at all, since no matter what functions I'd use - like DwmEnableBlurBehindWindow() -, none of them would actually affect the taskbar in a way that I wanted them to. I even tried turning the alpha levels of the taskbar's owner "window" down, but sadly that didn't work either - It made the taskbar icons transparent too which is a no-no for me, and it didn't actually remove the blur it just made the effect weaker.
As it seems that my skills are not enough to accomplish this task, I'm asking you - how can I remove the Aero blur from the Windows 7 taskbar? (Possibly using C++)
Remove Transparency that will do, else go to
Personalize by right clicking on desktop.
There go to theme, personalize the theme,
and find transparency/opacity. if you want with no blur and enabled transparency make it 100%
else disable transparency.
this you can do using c++ by doing twiks with Registry.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM]
"Composition"=dword:00000000
"CompositionPolicy"=dword:00000000
"ColorizationColor"=dword:6b74b8fc
"ColorizationColorBalance"=dword:00000008
"ColorizationAfterglow"=dword:6b74b8fc
"ColorizationAfterglowBalance"=dword:0000002b
"ColorizationBlurBalance"=dword:00000031
"ColorizationGlassReflectionIntensity"=dword:00000032
"ColorizationOpaqueBlend"=dword:00000000
"EnableAeroPeek"=dword:00000001
"AlwaysHibernateThumbnails"=dword:00000000
this are the values for Windows 7,
if you will change here, you will get the result. it contains all things you need to change.
you may change values for this three
ColorizationBlurBalance, ColorizationGlassReflectionIntensity, ColorizationOpaqueBlend
I think that will do :)
I found a small program that will remove the blur.
Link to DeviantArt
I'm trying to figure out how to create a graphical interface, in X11, which exists outside of a window manager's/desktop environment's standard window frame. For example, when Thunderbird finds new mail, it shows a special alert in the lower right hand corner of the screen which is shown without any frame (no close/minimize buttons, etc.).
I'm specifically interested in doing this in QT with C++, but if someone knows a solution with a different graphical library, that would be helpful too.
For QT pass Qt::FramelessWindowHint as a window flag when you construct your top level widget.
See here for more info:
http://doc.qt.nokia.com/main-snapshot/qt.html#WindowType-enum
You can do this with X as well although I haven't done so in a long time.
http://www.xfree86.org/current/XCreateWindow.3.html
With GTK you would use gtk_window_set_decorated(), which would probably be Gtk::Widget->set_decorated() (I think, I don't use gtkmm).
http://developer.gnome.org/gtkmm/unstable/classGtk_1_1Window.html#a67adb1d8051a38e0e5272f141bb8778c
I've seen things like this and I was wondering if this was possible, say I run my application
and it will show the render on whatever is below it.
So basically, rendering on the screen without a window.
Possible or a lie?
Note: Want to do this on windows and in c++.
It is possible to use your application to draw on other application's windows. Once you have found the window you want, you have it's HWND, you can then use it just like it was your own window for the purposes of drawing. But since that window doesn't know you have done this, it will probably mess up whatever you have drawn on it when it tries to redraw itself.
There are some very complicated ways of getting around this, some of them involve using windows "hooks" to intercept drawing messages to that window so you know when it has redrawn so that you can do your redrawing as well.
Another option is to use clipping regions on a window. This can allow you to give your window an unusual shape, and have everything behind it still look correct.
There are also ways to take over drawing of the desktop background window, and you can actually run an application that draws animations and stuff on the desktop background (while the desktop is still usable). At least, this was possible up through XP, not sure if it has changed in Vista/Win7.
Unfortunately, all of these options are too very complex to go in depth without more information on what you are trying to do.
You can use GetDesktopWindow(), to get the HWND of the desktop. But as a previous answer says (SoapBox), be careful, you may mess up the desktop because the OS expects that it owns it.
I wrote an open source project a few years ago to achieve this on the desktop background. It's called Uberdash. If you follow the window hierarchy, the desktop is just a window in a sort of "background" container. Then there is a main container and a front container. The front container is how windows become full screen or "always on top." You may be able to use Aero composition to render a window with alpha in the front container, but you will need to pass events on to the lower windows. It won't be pretty.
Also, there's a technology in some video cards called overlays/underlays. You used to be able to render directly to an overlay. Your GPU would apply it directly, with no interference to main memory. So even if you took a screen capture, your overlay/underlay would not show up in the screen cap. Unfortunately MS banned that technology in Vista...