You are not logged in.

#1 2019-05-24 17:57:59

Tof
Member
Registered: 2019-05-24
Posts: 7

Extension of the outline, edge of the window as in ..

Die hard 4.0
Screenshot will tells You everything >> imgur image

How to get the effect of extending the edge of the window to the end of the desktop, monitor like in the movie DieHard4.0?
I know it is possible, i have seen it before sometime ago in some adon or theme but don't know witch distro it was.. maybe it was in graphical driver option, like in programmer options in android phones with development mode on.
I remembered about it watching the movie a few days ago.

Multiple desktop user  - 3 screens 2x 22' and 1x40' xfce4 interface, updated.

Offline

#2 2019-05-24 20:07:17

seth
Member
Registered: 2012-09-03
Posts: 51,053

Re: Extension of the outline, edge of the window as in ..

Patch some compositor to paint random lines on the screen?

iirc kwin had an effect long time ago which would paint a fullscreen cross one the pointer, but idk anything that  would protrusions of the window edges. Or why one would do that.

Offline

#3 2019-05-24 21:19:10

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: Extension of the outline, edge of the window as in ..

It'd be pretty easy to write a X11 (WM-agnostic) tool that would do this with any WM provided there was no "desktop window" already obscuring the root window.  If there was a desktop window, there'd just be an extra step of detecting it.  In the absence of a desktop window:

1) listen for configurenotify events on all windows
2) respond to events by updating a list of window geometries and draw lines as desired on the root window
3) there is no three

This would be best done by patching the WM, though, as the WM is already doing all of this except drawing the lines - so rather than duplicating the window list data structure and having multiple processes listening to and responding to relatively frequent events, just let one process do it all.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2019-05-24 21:38:10

seth
Member
Registered: 2012-09-03
Posts: 51,053

Re: Extension of the outline, edge of the window as in ..

You also got to clear the window before painting - or use xor painting for line and clearing (both will be glitchy, esp. if there's a desktop shell window or other stuff painting into the root)
WMs used to grab the server in order to paint their resize outlines because of this. I'll postulate that this can only be reasonably done w/ and inside a compositor.

Offline

#5 2019-05-24 21:49:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: Extension of the outline, edge of the window as in ..

It depends on how you define a compositer.  It might* be wise to buffer the graphics and repaint the root window all at once, but this certainly doesn't require a compositor - unless your definition of a compositor is any X11 tool that buffers drawing.

*edit: actually I bet processing what needs to be drawn into an appropriately structured list, and having two X11 calls, one for XClearWindow and one for XDrawLines, you'd get very smooth performance.  Drawing each line individually and doing calculations between each line drawing might be problematic - but that's just a poor approach all around.

Note, I've done a lot of tinkering with "low level" X11 drawing, and I use pretty ancient hardware by today's standards - and I've never had performance issues or "glitchiness" when the code is written with an awareness of how X11 actually works (eg, to consolodate drawing and minimize round trips).  But this is just general good coding practice: the code solution should be for how the system executes processes, not how the programmer thinks about the processes.

There's nothing really different about this goal and more standard window decorations in terms of the load on the X11 protocol - in fact these lines would be far simpler than most decorations.  Yes, decorations are often in their own parent window, but not always.  See, for example, alopex (a ridiculous WM written by a slightly mad coder) which was well appreciated: it's tabs and window decorations with curved tabs, transparency, various theming options, etc, were all done on the root window.

Last edited by Trilby (2019-05-24 21:57:51)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2019-05-24 22:08:57

seth
Member
Registered: 2012-09-03
Posts: 51,053

Re: Extension of the outline, edge of the window as in ..

It's not so much a performance issue as about who paints what into which context when. Window updates erasing your lines etc.
Redirecting all windows into a compositor and have that paint windows and fancy stuff (shadows, random lines, …) is the only reliable way to be in control of the output.
Alternatively you could add a bunch of windows and XShapeCombineRegion/ShapeInput them…

Offline

#7 2019-05-24 22:35:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: Extension of the outline, edge of the window as in ..

seth wrote:

Window updates erasing your lines etc

How/why would a window update "erase" the root window?  That doesn't happen.

First, if backingstore is set for the root window, a window move wouldn't cause this - but more importantly, even if it wasn't set, every window move triggers a redraw of the lines on the root window anyways, so it's a moot point.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#8 2019-05-25 05:45:32

seth
Member
Registered: 2012-09-03
Posts: 51,053

Re: Extension of the outline, edge of the window as in ..

XSetSubwindowMode/IncludeInferiors (did you look at the screenshot he posted? Even w/o you'd have to maintain control over the root or desktop window)

The backing store is afaik btw. implemented on top of the composite extension nowadays (not sure about its default availability across the drivers, ie. whether it's enabled by default)

Offline

#9 2019-05-25 10:15:05

Tof
Member
Registered: 2019-05-24
Posts: 7

Re: Extension of the outline, edge of the window as in ..

Thank you for answers.
it is not as easy as it seems.

seth wrote:

Patch some compositor to paint random lines on the screen?

iirc kwin had an effect long time ago which would paint a fullscreen cross one the pointer, but idk anything that  would protrusions of the window edges. Or why one would do that.

So maybe is possible to get X,Y  points of each cornet of opened windows on screens ??  and like seth wrote  make two crossing lines in  right-top and left-boddom corners of each opened window??

Offline

#10 2019-05-25 12:10:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: Extension of the outline, edge of the window as in ..

seth wrote:

XSetSubwindowMode/IncludeInferiors (did you look at the screenshot he posted? Even w/o you'd have to maintain control over the root or desktop window)

Yes, I noted this in my initial proposal.  But this is relatively easy to do, especially if one has set out to get this effect on their system.

This is a bit like noting that network management tools could never work as they'd have to maintain control of the interface even when many other tools were trying to use it.  This is a true statement, but faulty inference.  Anyone who enables one management tool is expected to know that they did, they want to use that tool and will not use others for the same task.  On occasion people do blindly enable more than one, but this is user error an easily remedied.

So, what I assumed would be a given caveate: I do not know of a way to write a malicious program that will draw these lines on a system where the user is actively opposed to having them and doing things to prevent their appearance.  But getting them where they are wanted is, still, trivially easy.

Last edited by Trilby (2019-05-25 12:13:56)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2019-05-25 13:02:28

seth
Member
Registered: 2012-09-03
Posts: 51,053

Re: Extension of the outline, edge of the window as in ..

@Tof, detecting the window geometries is not the problem. The actual question is where you want to paint those lines.

If you have no "desktop window" (icons/applets etc. - I'm pretty sure that xfce has a desktop window, though) and want the lines only to appear below all other windows (ie. on the root window) and nothing else (like eg. idesk or conky) paints on the root window, Trilby is right and you could just write a daemon to paint those lines onto the root window.

If you want those lines to also overlay windows (and because afaik xfce has one anyway) the best way would be to patch the compositor to add such effect.

Offline

#12 2019-05-27 19:43:12

Tof
Member
Registered: 2019-05-24
Posts: 7

Re: Extension of the outline, edge of the window as in ..

Hi.
I didn't wonder where and how to paint lines, that's why I started this thread because I wanted to know if it is already available somewhere as eg. theme, conky, or some different compiz-similiar program... or if it would be difficult to achieve such an effect.
It would be nice if every window would leave lines on the same layer, although the effect would start to disturb having several windows in different positions on multiple screens. So For first i will try to draw them somehow on root window.
@seth - can you write how to retrieve window positions?
With small steps maybe something comes of it smile

Offline

#13 2019-05-27 19:58:27

seth
Member
Registered: 2012-09-03
Posts: 51,053

Re: Extension of the outline, edge of the window as in ..

man XGetGeometry

I take you've never written any X11 code? At least C (or C++)?

Offline

#14 2019-05-27 20:18:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: Extension of the outline, edge of the window as in ..

That'd get the geometry at one time.  This is why I suggested listening to configure notify events: your program would then get informed of all changes in window geometry so you could redraw the lines.  The event structure for configure notify itself contains the x, y, width, and height of the window.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#15 2019-05-27 20:59:34

seth
Member
Registered: 2012-09-03
Posts: 51,053

Re: Extension of the outline, edge of the window as in ..

man XSelectInput, you want SubstructureNotifyMask, then loop XNextEvent and handle ConfigureNotify events. Then check whether that's a direct child of the root window and not override_redirect (XGetWindowAttributes)
You could also only handle window additions and keep toplevel windows in a list where you select StructureNotifyMask only.

Maybe have a look at https://gitlab.freedesktop.org/xorg/app … xcompmgr.c

Offline

#16 2019-06-17 18:02:04

Tof
Member
Registered: 2019-05-24
Posts: 7

Re: Extension of the outline, edge of the window as in ..

seth wrote:
man XGetGeometry

I take you've never written any X11 code? At least C (or C++)?

Nope. I use C,C++ to program electronic devices only (atmel chips like in arduino but i always erase bootloader and use C) from fev years it's only hobby. Never use it for system mods. I use bash to write some life-hacks scripts for system but never something advanced..

Offline

Board footer

Powered by FluxBB