View Full Version : Flat cube plugin.
neo
May 19th, 2007, 10:51 AM
I really don't know how to describe you this idea, so I'll give you an example.
Open ccsm and set: virtual-h-size=2, virtual-v-size=2. Now we have 4 desktops. But when we use our cube plugin - it is completely flat and we can use only 2 desktops. Of course here great plugin is expo. But it would be great if someone could add something like this:
if you rotate the ,,cube'' right - you switch to the second workspace
if then you rotate the flat cube down (normally to see it's bottom) you switch to the fourth worspace (while switching it should be upside down), and so on
I don't think it will be difficult to implement. I think the only problem would be when you try to switch horizontally and vertically at the same time ;-)
Switching from desktop 1 to desktop 3:
http://img144.imageshack.us/img144/9333/flatcubevb8.jpg
Kristian
May 19th, 2007, 02:50 PM
I really don't know how to describe you this idea, so I'll give you an example.
Open ccsm and set: virtual-h-size=2, virtual-v-size=2. Now we have 4 desktops. But when we use our cube plugin - it is completely flat and we can use only 2 desktops. Of course here great plugin is expo. But it would be great if someone could add something like this:
if you rotate the ,,cube'' right - you switch to the second workspace
if then you rotate the flat cube down (normally to see it's bottom) you switch to the fourth worspace (while switching it should be upside down), and so on
... And what if you choose a 3x3 layout, not 2x2 which you describe?
These sort of ideas have been discussed several times before. Think of your desktop as a rectangular sheet of paper: We can bend it in any way we want, but we can't cut it. Now you should see the problem with your suggestion. Attempts to cutting this sheet would just end up as ugly ugly hacks... Overlapping would be even worse. That's just how X works.
[quote:d7d8f]
I don't think it will be difficult to implement. I think the only problem would be when you try to switch horizontally and vertically at the same time ;-)
[/quote:d7d8f]
Patches are welcome.
neo
May 19th, 2007, 03:21 PM
If you choose 3x3 it will be the same. Just it won't be normal rectangle with two sides... it will be rectangle with 4 or 9 sites. If you switch right - you'll se 2 desktop. If you switch down - you wont see upsite-down 1 desktop but 4 desktop.
I'll be happy if I could write something like this, but I'm only websites programmer (php, js, mysql). I know c, but I'm not advanced c programmer. I want to learn some about c on holidays. What do I have to know to write some compiz plugins? What do I have to learn?
You've written that we can't cut our desktop. Could we display only for example the first and the fourth desktop behind? And then replace the first with the third and so on? Would it be possible?
Kristian
May 19th, 2007, 07:58 PM
If you choose 3x3 it will be the same. Just it won't be normal rectangle with two sides... it will be rectangle with 4 or 9 sites. If you switch right - you'll se 2 desktop. If you switch down - you wont see upsite-down 1 desktop but 4 desktop.
I'll be happy if I could write something like this, but I'm only websites programmer (php, js, mysql). I know c, but I'm not advanced c programmer. I want to learn some about c on holidays. What do I have to know to write some compiz plugins? What do I have to learn?
You've written that we can't cut our desktop. Could we display only for example the first and the fourth desktop behind? And then replace the first with the third and so on? Would it be possible?
You've lost me in about 7 diffrent ways now...
I think it would be easier if you made some drawings of what you mean (in decent size), so I can understand where you're going. What you have to keep in mind that a desktop looks sort of like the attached sketch.
[attachment=0:5f253]viewports.png[/attachment:5f253]
We can bend it as we see fit with compiz, but the windows can only move like the original rectangular desktop describes. We can't make windows warp from one desktop to another if there is another desktop between in, since we can't rip up the windows. Cube works because we simply bend the desktop around a cube, and when we display it, we make it look like there is no end, because the last viewport is "attached" to the first one, but this is only because that's how we're displaying it.
When you're thinking about this, you must keep window movement in mind... it is fundamental to be able to move windows around naturally.
As for what you need, it's not really much. But cube is a horrible place to start. It's fairly easy to work with simpler plugins. You can work with cube too, of course, but I wouldn't advice you to try to change the fundamentals of it just yet. You will eventually need some OpenGL knowledge and Xlib knowledge, but you can get pretty far without it too.
neo
May 19th, 2007, 09:02 PM
I have learned more natural and practical English so it is very difficult for me to say what do I think about a cube which I want to make flat and about crazy rotation. I'll try to make some screenshots and show you, but the main idea is: (example once more)
1. switch to v-size to 2
2. if you rotate the ,,cube'' right - you'll see the second viewport (viewport, right? not desktop)
3. if you rotate the ,,cube'' right once more - you'll see the first one back
And now with new plugin:
1. we'll switch v-size to 3, but the ,,cube'' looks like before with 2 (it's completely flat and have only 2 sides)
2. we rotate the ,,cube'' right - we see second viewport
3. we rotate the ,,cube'' right - normally we should see the first viewport, but we see _the third_
4. and if you rotate right - we'll see the first viewport
5. the same effect when we rotate down or up - we just have to dynamically set which viewport is on the ,,other side'' of the cube - if we rotate left - we'll see for example 1, if we rotate right - we'll see 3.
SmSpillaz
May 20th, 2007, 06:11 AM
Wall is your friend. Basically, the Cube is a physical object and not an animation. So you cant have a nine-sided Cube. because a cube only has six sides, back,front,(left*1/2 Horizontal size),(right*The other 1/2 of the Horizontal Size),up and down. Up and Down are not usable because a cube MUST be square (Or an even polygon), so the square resolution does not display properly on any monitor because it is a square and not monitor resolution is square (1024x768 <> 1024x1024)
Wall will allow you to do this however.
Kristian
May 21st, 2007, 12:41 AM
I have learned more natural and practical English so it is very difficult for me to say what do I think about a cube which I want to make flat and about crazy rotation. I'll try to make some screenshots and show you, but the main idea is: (example once more)
1. switch to v-size to 2
2. if you rotate the ,,cube'' right - you'll see the second viewport (viewport, right? not desktop)
3. if you rotate the ,,cube'' right once more - you'll see the first one back
And now with new plugin:
1. we'll switch v-size to 3, but the ,,cube'' looks like before with 2 (it's completely flat and have only 2 sides)
2. we rotate the ,,cube'' right - we see second viewport
3. we rotate the ,,cube'' right - normally we should see the first viewport, but we see _the third_
4. and if you rotate right - we'll see the first viewport
5. the same effect when we rotate down or up - we just have to dynamically set which viewport is on the ,,other side'' of the cube - if we rotate left - we'll see for example 1, if we rotate right - we'll see 3.
I think I understand you: Rotating left/right switches the horisontal viewport (yeah, it's viewport, not desktop), and rotating up/down switch the vertical viewports?
If that's what you're talking about, it sounds very feasable, but it sounds like something that wouldn't be very practical. Cube works be cause it is easy to get an overview, but with this, it would be harder, I belive.
I think your idea still has some merit, it is certainly one of the few that's techincally possible to implement without redesigning X from scratch. But I don't think you're entierely there yet, because It hink it'll only be possible to use it with very few viewports if you want to still keep the overview that the normal cube gives you. I'll think about it a bit, at the very least, it would be an interesting experiment.
minowicz
June 7th, 2007, 07:37 PM
OK, there may be something that I'm misunderstanding, so please correct me if I am wrong somewhere in all of this.
The way the cube uses viewports now is that we create a large virtual desktop and wrap it around the cube's sides.
Let us assume that your screen resolution is 1400x1050.
If you make your horizontal virtual size 4 and your vertical virtual size 2 then you have two virtual desktops, each 5600x1050. We then display viewports on each side of the cube such that each viewport is one 1400-pixel long section of the 5600-pixel long strip. Switching from one virtual desktop to the next remaps the surfaces of the cube to the next 5600x1050 strip.
Increasing or decreasing the horizontal virtual size simply increases or decreases the horizontal virtual resolution boy 1400 and we respond to this by adding or subtracting a side in the extruded polygon (a better name than cube when HVS is >=3, though not as cool when 1 <= HVS <= 2). That's why there is never any actual desktop on the top or bottom surface. We just wrap around.
Your comments regarding cutting up the desktop as a limitation of X and preservation of the natural movement of windows seem incorrect to me. I'll elaborate in the next few paragraphs.
As far as I know, viewports are very much as the name suggests a view of a particular portion of the virtual desktop we are on. There is for example no reason that they have to begin on some multiple of our screen resolution (again, if I understand correctly). This should mean that there is nothing stopping us from displaying the same area of the virtual desktop on more than one face of the cube, or of displaying any arbitrary area of the virtual desktop on any given cube face.
Movement of windows from one face to the next should be totally independent of the portion of the desktop displayed in the viewport beneath the window being moved. Even if you did somehow have to deal with showing a window moving from one area on the desktop to another (non-adjacent on the virtual desktop) area that is displayed on an adjacent cube face, we have the ability to clone the window to display it in two places at once. We also have the ability to perform arbitrary transformations of the window, such as making a portion of it transparent or clipping its output. Together such techniques would allow preservation of the natural movement of windows between cube faces with arbitrary areas of the virtual desktop displayed on them.
The real problem is how to make sure that the entire virtual desktop is available on some surface of the 'cube' when it is has an arbitrary number of sides. Either that, or the inverse, of ensuring that there is never anything in the areas of the virtual desktop not shown on a face of the cube. That is what makes it hard to do things like map desktop surfaces to the top and bottom of the cube or to have non-rectilinear faces (of questionable value at any rate) or to have arbitrary numbers of face on the 3-d object to which we are mapping viewports.
In the following I will use 'desktop' (in quotes) where what I really mean is a portion of the virtual desktop with coordinates that map to some integer multiple of the screen resolution.
Imagine the case of HVS=4 with mapping of a desktop to the caps of the cube on our 1400x1050 screen. You might make a virtual desktop that is 5600x3150, a 3x3 virtual desktop size. You'd take your sides of the cube from the strip of 'desktops' in the middle row and your caps from the first 'desktop' in the top and bottom rows respectively. But then you've wasted 4 desktops' worth of real estate. Worse, you have the problem of what to do if something somehow gets onto one of those unmapped areas.
OK, how about a 5600x2100 area in which we get our sides from the first row of 'desktops' and the top and bottom caps from the 1st and 3rd 'desktops of the bottom row? Same problems as above, but we have a smaller amount of wasted resources and real estate.
But maybe I've got this all wrong. I've not done any serious X programming in ages and most of that was Motif stuff back in the day, not actual "hey, let me do window management" stuff. I've certainly not actually dug into the code of any of the compcom stuff to see how it works. Here is a giant grain of salt. Please, take it.
Personally, I see all of this as potentially a dead-end anyway. We'll get input redirection and people will start designing 3D windowing environments in which the windows are not pinned to a desktop, but free-floating in space. We'll move the windows around or move our viewpoint through a forest of windows. Either way, the concern of desktops and viewports will go away. Better still will be the day when applications themselves are volumes and not limited to planes.
Deciare
June 8th, 2007, 12:21 AM
I think I understand you: Rotating left/right switches the horisontal viewport (yeah, it's viewport, not desktop), and rotating up/down switch the vertical viewports?
If that's what you're talking about, it sounds very feasable, but it sounds like something that wouldn't be very practical. Cube works be cause it is easy to get an overview, but with this, it would be harder, I belive.
I think your idea still has some merit, it is certainly one of the few that's techincally possible to implement without redesigning X from scratch. But I don't think you're entierely there yet, because I think it'll only be possible to use it with very few viewports if you want to still keep the overview that the normal cube gives you. I'll think about it a bit, at the very least, it would be an interesting experiment.
What he describes is almost exactly like the way Wall behaves right now, if you enable the Allow Wrap-Around option. He's not talking about a cube at all, but a flat sheet that flips horizontally when moving along the X-axis of desktops, and flips vertically when moving along the Y-axis. Hoziontal Virtual Size and Vertical Virtual Size determine the length of these axes.
It'd make more sense to add this kind of animation as an option to Wall than to derive something from Cube.
vBulletin® v3.7.1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.