For lack of a better name...

Saturday, April 25, 2009

Untitled

Compiz is being ported to c++, and this (as well as the usual problem of time) has lead to a temporary postponement of work on jasper. To say that "it lead" is probably a bit deceptive, as I had not made commits for quite a while before the port was announced - but my intention is (in due time) to rewrite it (or, rather, write it again) in c++. Also, since compiz is now a reparenting wm, I have to look into how that affects the decorators. Hopefully, c++ will make it easier to do what I want (which I was having difficulty doing originally, which started the long period of no-commits)

In order to get better acquainted with c++, I started another plugin: tag. This is based, somewhat, off a feature request on the forums.

The idea is that the user can create a number of tags, and assign various tags to different windows. Each tag is either activated or deactivated, and a window with an active tag is considered active (the window with focus is also considered active). Non-active windows are drawn translucent, while active ones are drawn opaquely. Activating or deactivating a tag will restack the windows, so that active windows are sitting on top, while non-active windows are below - the original stacking order is maintained (apart from the active ones are pulled to the top).

There is a slight issue with this, in that it wouldn't work without patches to compiz's stacking code. Unfortunately, these patches haven't yet been committed to compiz, but if anyone is using master and wants to test them they are here (one and two).

There is still some things to do:
- Currently when you entering a tag, things don't work like they should if you press space or shift, etc. I need to copy some code from scalefilter to make this work properly.
- Currently, the only way to create tags, add/remove tags to/from windows, activate/deactivate tags, is by pressing a keybinding which grabs input and catches what you type (nicely displaying it on the screen at the same time). Ideally, you should be able to use Dbus, or add a specific keybinding to say, activate tag foo. The first should already be possible (except dbus isn't yet ported), and the second will need some reworking of the options code (which I hope to do, one day...)
- Let other plugins extend what tag does. For instance, another plugin could use the active status of a window (or whether it has a specific tag, etc) to decide whether it should be, for example, displayed in a scaled mode on the side of the screen, or as a normal window. On the other hand, other plugins should be able to influence the active state of the window (eg, if it is focused, some match rule things, etc)
- Automatically adding tags based on rules (eg, I could make a rule to tag firefox, xchat, pidgin as internet, and another rule to tag gnome-terminal and gedit as dev). At the moment all windows are just tagged with "default"
- Whatever I have forgotten
- Something about tiling?

I've also been accepted for Google Summer [or, rather, winter] of Code. Peter Hutterer will be my mentor, and I'll be working on getting input redirection in X :) So, if my work goes well, we will hopefully have IR next year.

Also, for those with ATi cards, dri2 is working almost very nicely :) Thanks to the work of Dave Airlie and Jerome Glisse (and others). Unfortunately, since I am using compiz master, I have no cube + glxgears to show-off, but it does work very beautifully in scale mode. [though, I don't think I really want to use the word beauty: "Don't use words too big for the subject. Don't say 'infinitely' when you mean 'very'; otherwise you'll have no word left when you want to talk about something really infinite." - C.S. Lewis]

Saturday, May 31, 2008

Text plugin for jasper

Well, I haven't had much time to work on jasper the past few weeks, but now there is a few new features.

Firstly, there is a new build script, thanks to some-guy. This is very useful to me, as it makes it less work for me to add new plugins. It also adds "make like" output, which can be useful if something is failing (if you pass quiet it will only display errors). Also, passing clean ("./build.sh clean") will clean up all files generated by building, which is also a very nice feature.

The only other visual change was the addition of the "text plugin", which is used to display the title of a window. Some things which I still have do do for this plugin is make it update when the title changes, and also properly handle the case when the title is too long (at the moment it will just keep on writing, potentially over-top of other buttons). The font and font-size is the only part which is currently editable by the theme, though I do hope to add some other options (such as colour, style, etc)

The updated theme now looks quite a bit more bulky, but I'm only updating the theme to show (and test) new features, so I'm not concerned with usability yet.

Saturday, May 17, 2008

Well svg loading now works. Although, it isn't displaying the svg's, it is using the shape of the svg and then drawing colour (it is used in cairo as a mask). At the moment the colour is specified by the theme, but I hope to add the ability to get the colour from gtk. Also, it should be relatively simple to use gradients rather than plain colours, or use an (svg) image instead.

I added (well... copied from compiz) a timeout system, which basically allows plugins to get functions called as often as they want (they specify a time, and when it is done, the function gets called). I used that to allow 'animated' themes. By animated I mean the colour slowly shifts between two colours (although alot more is possible)

For those who are trying it out, and want to disable the animation (I will in the 'default' theme soon), just remove the target and dif tags (within cairoanimation). Also, one thing to notice is that you can use the different methods at the same time, one button could be a png image, while another could be a colour fading svg image.

Next is work on the state handling (of windows and buttons), this will allow things like changing decorations when maximized or shaded.
Maybe add gradient support.
Add a dbus plugin and a plugin that allows buttons such as shelf and maximumize.
Moveable tabs.
Proper theme loading / settings loading (parse the themes when you start decorator rather than when you open a window)
And many more things :)

EDIT: seems that it doesn't like xml tags in there...

Wednesday, May 7, 2008

I've added some more things, and fixed some bugs:

Use pkgconfig in the build script - this means no need to change the build script if you have things installed to nonstandard locations

'Handle' some "toolkit actions" - this is the main menu / run dialog when pressing alt+F1/F2 respectively - this will only work if you have a gnome panel (as all it does it relay the messages to that)

The two worst bugs should be fixed. New windows should now get decorations (thanks to maniac103's suggestion to use mapNotify instead of createNotify to add windows), and it shouldn't crash when closing, then opening another window (as I wasn't properly removing the windows, which was causing it to crash when opening another)



TODO (short-term and in no particular order):
Fix crashes under certain circumstances (opening the advanced search in ccsm)

Add better button support (if you press mouse than move it off button, it shouldn't trigger button when you release it)

More drawing plugins (svg's, animated borders, etc)

Make new windows position account for the decorations straight away (rather than appearing in one spot and then jumping to another)

Fix the appearance of the decorations when the window is transformed


EDIT: I thought buttons acted differently than they do... fixed

Tuesday, May 6, 2008


I have seen a couple posts on the forums regarding the new decorator, codenamed: jasper, so I thought I would post a little information on it.

Rather than basing the decorator off emerald or g-w-d, I decided to base it off comipz. It is similar to compiz in that it uses a plugin system very similar to compiz (in fact, the code that does this is copied from compiz and only slightly modified).

Something I hope to accomplish with this, is to allow for excessive customization through the use of plugins. I decided to make it after trying to add customizable buttons to emerald/g-w-d. I think that doing customizable buttons cleanly requires plugins, so that is why I use plugins. Another benifit is that if you want to draw something differently, all you need to do is use a different plugin. One theme could use an image plugin to draw a buttons, while using another plugin to draw a pulsating border using cairo.

Per window themes is also another thing which I want to add (so different windows get different decorations), or a decoration based on which user is running the process that the window is associated with (so, for instance, if you are running an application as root, it could receive a different border). So much is possible (at least, I can't yet see why any of the afore mentioned things would prove problematic - however, that often changes when actually coding it :D)

As DarknessssenkraD said in his post (at least according to google translations), the state is "ultra mega alpha" - and I think that is a good indication of its state, it 'works' (sometimes), but there is a lot of work to do (both in stability and features).

For those who want to try it out (also from DarknessssenkraD's post):

git-clone git://anongit.compiz-fusion.org/users/b0le/jasper
cd jasper
./build.sh
./jasper --replace
(only need the second one if it doesn't work first time)
./jasper --replace

It would be good to note that my build script isn't very good (feel free to volunteer to fix it). One problem is that if compiz is not installed to /usr/local, you may need to run 'CPATH="$PREFIX/include/compiz" ./build.sh'
So if you have, say, a normal ubuntu package, you would run 'CPATH="/usr/include/compiz" ./build.sh'

Currently the only dependencies are X, cairo, libxml2 and libdecoration (so to compile it you will need the appropriate files)