ChaniBlog











{June 23, 2008}   soc week 4

I took a bit of an unscheduled break this week. didn’t write any code until sunday (although I did read and think about and talk about code). :) it was nice to just relax for a while.

unfortunately I haven’t *quite* got my goal for the week finished. input is somewhat partially working; I can click on things, and keypresses are going through, so the basic stuff is there. contextmenus and plasma-dialogs work, although they’re drawn below the semitransparent containment background (it’ll be fully transparent later, but this is useful for debugging). the add-widgets dialog and config dialogs aren’t showing up, but I’m sure they’re out there somewhere. ;) what bugs me right now is that qactions’ keyboard shortcuts aren’t working at all, and I’m not sure how to solve that one.
the code for this stuff is currently in the ‘input’ branch on gitorious.

if I’m lucky I’ll get those bugs ironed out tonight or tomorrow and be back on track for this week’s goal - requiring a password to unlock plasma. and if I’m not lucky… well, that’s why week 6 was left blank. :)

oh, and my email got pretty backed up while I was relaxing. I’d only been keeping up with things addressed directly to me and a few important parts of lists, and ended up with around 2500 unread messages! :/ it turns out that a little over two thousand of them were plasma bugreports; I hadn’t touched that folder in about two weeks, and before that I hadn’t quite been keeping up with it (it was hovering around 500 for a while).

so, I gave up and marked the folder as read. it’s starting to fill up again already. :/ ick. there are way too many bugreports there. being busy with soc, reading them isn’t really a useful way to spend my time anyways, I guess.



{June 17, 2008}   soc week 3

these weekly reports are going to be pretty boring if I keep blogging about what I’ve done halfway through the week. :)
I haven’t written any code since then; I spent my time dealing with some Real Life stuff I’d been neglecting, then getting outside and enjoying the sushine. :) I need to remember to spend more time outside the house and not get lost in my computer.

I did do some planning for this upcoming week, though. hopefully getting input working properly won’t be too much of a headache… we’ll see. I don’t think I’ll have time to actually write the code for that for another day or two.



{June 12, 2008}   shiny!

whee! only thusday and already I have my goal for the week done. I have plasma-overlay displaying properly over the screensaver. on my laptop, where composite is on, I can see them both together. on my desktop, where composite is off, I only see plasma (and the screensaver process should be nicely suspended). I have a screenshot of the composited one, and as usual the code is up on gitorious. :)

I had to set up a dbus interface before this would work - need to pass the winid n’stuff. There are some nice techbase tutorials, but I still ended up banging my head against the wall a few times :P I’ve never worked with dbus before. still, in the end I managed to do everything in a way that feels nice. :) I’m quite happy that I managed to get cmake generating both the xml and the adaptor-class for me. :)

once dbus was working, then I had to get the window stacking order right, so that plasma-overlay was above the saver and under the lock dialog. ohhh, the headaches that caused. as I was on my way to a party last night I realised that half my problem was that I was using the wrong winId. :) so when I got home of course I had to go bacck on the computer and test this, and bam! plasma-overlay shows up. :D
…and then I discover that I can’t get rid of it. the screensaver won’t respond. killing krunner_lock crashed X. doh. turns out I had an infinite loop in the stacking code because I ignored a comment about infinite loops… :) once I had that fixed, I polished off a few things, and… well, it works now.

of course, when I say “works”, I mean it displays the way I want it to. I still have the problem that the unlock dialog steals all input, so I can’t actually *interact* with plasma from the screensaver. but that’s next week’s goal. :)

I guess now I can spend the rest of the week seeing if non-compositing ways of trying to draw the screensaver are really as bad as I think they are. or fixing plasma bugs. or just enjoying the sunshine. :)



{June 9, 2008}   soc week 2

well, I pretty much covered it in my last post: I haz code now. yays.
since then I’ve cleaned up some little things and created my own containment without all the useless desktoppy stuff, so I’m back on schedule. :) I poked at the appearing-below-screensaver issue, and fredrikh gave me some pointers, but… I’d actually totally forgotten about that until a minute ago. luckily I still have the window open, so perhaps I’ll work on it tonight. looks like I also have to make a dbus interface for the lock process and the plasma one to talk to each other.

once I’ve got that dbus stuff running, I guess I’ll have to figure out once and for all whether there’s any feasible alternative to using composite.

actually, I just had an interesting thought, right this second.
see, for desktop containments, in 4.2 we’re planning to have background-drawing plugins, so that you can do things like using a folderview as a containment and having wallpaper in it too. I wonder… if a way to draw screensavers in the plasma process were to come along later, could it be done as one of those plugins? if it could, then it could be done later, if someone figures out a way after soc is over.

just a thought. might not necessarily be doable - drawing on the canvas would be sucky. but to get behind widgets you basically have to be drawing on the canvas, or drawing in the view’s background-painting function (and it’s not like that gets called at 20fps or anything), so there aren’t that many non-composite options for screensaver stuff in the first place.



{June 6, 2008}   let there be code!

I just pushed the first bits of my soc code to my public git repo. :) the code is awful and hackish and probably has lots of problems besides those noted in the merge commit-message, but it runs and you can add widgets. :)

right now there are two main problems with it. first, the only way to stop it is with `kquitapp plasma-overlay`. it’s easy to hide it, but impossible to re-show it. second, when it’s started via the screensaver, it shows up *under* the screensaver. fun, huh? oh, and if you want to compile it, see README.git first. and be aware that it’s based on a copy of workspace/ that may not be entirely up-to-date (aren’t bic changes fun?). doing a git svn rebase seems to spew commit messages all over gitorious; I wish there was a way around that.

I’m hoping that ossi can help me get it running over the screensaver nicely, because that code isn’t always easy to understand. aseigo, ossi, sebas: if any of you have time, please review the code for me :) I’ve never really written an app from scratch, there’s lots of copy&paste from plasma/plasma, and I’m sure there are tons of things I’ve done wrong. (should my app even be a KUniqueApp in the first place? should it fork? etc, etc…)

oh, and I suppose I should add my own name to some of the copyright somewhere. I’m terrible at attribution - there must be a ton of files in plasma that should have my name in them and don’t :P

now, since I don’t see aaron or ossi online, I guess I’ll work on making my own containment so I can stop using the desktop one. :)



{June 1, 2008}   soc week 1 - busily going nowhere

wow. last week seems like a long time ago.
soc, for me, started monday evening, when I spent a few minutes tossing together a quick hack and got this:
screensaver + clock
that made me pretty happy - I had a plasma clock, and I had a screensaver, with very little effort, and they were mostly getting along. there was just that pesky green background to get rid of.

after a few days of banging my head against walls, I finally conceded that qt and X11 just weren’t capable of making that background go away. not without awful masking hacks that would probably not be worth the effort. so, I have two possible ways of dealing with this: either make it depend on composite to show both widgets and the screensaver, or change how screesavers work. the former sounds a lot more likely. :)

anyways, I decided to put those troubles aside for next week, and focus on getting some basic groundwork laid. I got kde4 compiled on my desktop, fought with suse and zypper a lot (I’ll post later about my impressions of suse), got things up and running, brought over some of my settings and scripts so that I wouldn’t go insane, got git installed, fought with git a tiny bit (I like it so far), and… didn’t get to much coding.

I was actually set up and ready to write code on friday, but Real Life has been getting in the way (hey, it *is* the weekend), we have a houseguest sleeping in the computer room, I’ve been procrastinating a little too, and it seems like every time I feel ready to start coding something jumps up and demands my attention - or I somehow find something more important to do. ;) at least I managed to channel some of the procrastination into useful things like answering questions and doing laundry and fighting weeds. now I’ve realised that the code I was going to copy&paste as a beginning has some really stupid bugs that I should fix first - after all, I’m going to need to fix them before 4.1 is released anyways.

so… yeah. not much of any code to show for this week. monday’s going to be busy, too. guess I’ll have to get up early in the morning and get the RL stuff dealt with so I can get lots of code written when the computer room isn’t occupied.

right now I have to go get dinner started… where does the time go? :P



{May 26, 2008}   getting to the root of the problem

so today was officially the start of summer of code, but I wasn’t at my computer. I spent the day playing in the dirt ;)

We were woke up this morning by the arrival of a truckload of dirt - we weren’t actually expecting it until the afternoon. soon after that, my friend showed up with a bed for me. yay, real bed, no more futon mattresses on the floor :) so we got the bed set up, moved some of the dirt, and had some breakfast.

once breakfast was dealt with, I went out to help pete with the humongous pile of dirt. it was a LOT of dirt. a mountain of it. way more than we needed. anyways, he asked me to do some weeding - the morning glories needed to be pulled out. I was a bit disappointed at first ’cause I think they’re pretty, but then I saw why they must be killed: they were everywhere. around the deck, under the deck, *in* the deck, around the house, and of course in the flowerbeds.

so, I started tearing it up. the more I pulled, the more I got. I ended up kneeling in the dirt, following the root systems and pulling them out as much as possible. the roots had gone right *through* the planks that were the border of this flowerbed, and when I realised one plank was loose and pulled it up, I just saw a huge mass of roots. I was digging about 6 inches down getting as much out as I could. eventually I took off my shoes because they kept cutting off circulation to my feet. I was pretty dirty already by then. it was fun :D

while I was digging up roots, pete was shoveling and wheelbarrowing dirt around. he covered the backyard, gave some of it to neighbours, covered the space beside the deck (after mowing the area and putting down some layers of grass clippings and cardboard), put more dirt on everything, and *still* had a big pile of it sitting in the alley, and the sun was starting to go down… so he moved that pile as much onto our property as possible - I came to help with the last bit of that as I’d finished clearing the flowerbed - and then we headed inside for dinner. hooray for roommates cooking. (they weren’t around for most of the yardwork because they had to go to work.)

of course, I had to shower before eating, since my hands and legs were totally covered in dirt. :) it took a lot of scrubbing to get most of it off. I still have a little on my hand. :P

now I’m fed, and tired, and… holy crap it’s almost 10pm. the day is pretty much over, and I haven’t had any time to code. Tomorrow I should be back on the computer, though. lots to do. :) according to my schedule I’ve given myself three weeks to get plasma and a screensaver displaying properly together, but I do hope it won’t take that long… I’d really rather have that happen tomorrow ;) gotta have those unreachable goals to aim for, y’know.

oh, and keyboard shortcuts have changed slightly for the sake of non-US keyboards. they may change again (specifically, ‘zoom in’ probably will).



{May 23, 2008}   state of the ZUI

another thing I’ve been chipping away at for 4.1 is the ZUI. it’s far from complete, but it’s at least becoming something I actually use now. :) keyboard shortcuts can be used to navigate it quickly (see my previous post), clicking a containment will make it the active one (barring the focus bugs mentioned in that post), and notmart has amazingly made the cashews actually show up in the right place! :)

I also added an option in the contextmenu for removing activities. right now you can only remove ones that aren’t active (ie when you call up the dashboard you don’t get that containment shown) but it’s pretty useful when you’re playing around and add way more than you actually want. :)

Oh, and if you don’t want to zoom out, you can use the keyboard shortcuts to switch containment instantly. my extreme laziness leads to features like this. :)

There are some features I didn’t get to, though… I wanted some kind of visual clue as to which containment is active, but seeing as I haven’t even started to think about how to implement that and soc starts monday, I doubt it’ll happen for 4.1. I also wanted a way to change which plugin the current containment uses - kinda ’swap out’ the containment under all its applets, so that you can go from defaultdesktop to blankdesktop to folderview at will. At the same time, I wanted to kick the theme config out of the defaultdesktop config, because it really doesn’t belong there - but there was really no time for that, and anyways, the other containment changes coming in 4.2 might mean someone else handles that :)

There are some rather obvious bugs in the ZUI right now - dashboard has issues with containment switching, and you can’t drag the view around while zoomed out any more - but I’m confident those will be fixed for 4.1 :) so we should have something simple but useful. with the keyboard shortcuts you don’t have to keep moving your mouse to a toolbox and finding the buttons, and with a single click you can choose the containment you want, so hopefully I’ll find myself making use of the ZUI more regularly from now on. :)

just… if you have two monitors… don’t zoom out both at once. trust me… just don’t.

As for the future of the ZUI… there’s still lots to be done. some of the bugs I run into are making me think that there’s a bigger problem. I’ll have to do some deep thinking about the design… what really belongs in the desktop toolbox? should we have some other tools elsewhere or something? what changes should be made to the fully-zoomed-out level? how do we handle multiple views without madness?

I have a feeling there were other zoomy things I was pondering, but it’s past my bedtime now. I’ve barely left the computer in over 12 hours :/ but I’ll be out in that big blue room all day tomorrow, so I guess it balances out in the end ;)



{May 23, 2008}   keyboard shortcuts and code duplication

I may not have blogged in a while, but I’m still programming. last week I was obsessing over keyboard shortcuts; I was bloody sick of having to use my mouse so much in plasma, especially since my poor laptop mousepad isn’t as reliable as it used to be. I was also annoyed at all the different scraps of code I saw scattered everywhere for common actions like “zoom out” and “configure $foo”. after thinking about these two problems for a while, I realised that they were actually one. I spent some time pondering the interconnectedness of all things, but eventually realised I was going to have to *write* some code instead of just thinking about it. ;)

Anyways, the root of the problem is that hardly anyone was using QActions, and where they were using them, they were just creating their own and then throwing them away. silly and wasteful. so, I gave each Applet a KActionCollection, and dropped some useful actions in there. I rounded up a bunch of code that had been creating its own actions, and made it just grab the ones from the collection. I added keyboard shortcuts to the actions. I even added some new actions for stuff like moving focus to different applets and different containments - those are only used for their keyboard shortcuts, but they go in the same little collection where I can keep an eye on them. :) Oh, and the toolbox also uses these actions now. hooray, less duplicate code!

Now, with all these actions rounded up and duplicates removed, I only needed one block of code for each change to them. when you lock plasma, the “lock widgets” text changes to “unlock widgets”, and the icon changes too. I now just have one place where this happens, and instantly the change applies to the toolbox and the contextmenu - previously the toolbox lock button didn’t change its icon at all, but now little inconsistencies like that are gone. When you lock plasma, the “add widgets” action is disabled too - one line of code and it’s gone from the toolbox and the contextmenu, and the keyboard shortcut goes away too.

Of course, I did run into a few little problems while doing this. QGrapphicsView and co. haven’t really got proper keyboard shortcut support. I can’t seem to add actions to QGraphics items. luckily, KActionCollection has a handy function to associate a widget with its actions - so, I cheat and associate an applet’s actions with the view while it has keyboard focus. The next problem was that clicking a proxywidget can give it text focus, but doesn’t give any notice of this to the rest of the graphicsscene - so, if you’re using plasma keyboard shortcuts on one applet, then click on another applet and happen to click a proxywidget (like the text entry part of the notes applet), plasma shortcuts will still apply to the previous applet. I haven’t thought of a way around that, so it’ll probably be that way until qt brings a fix. :( Then there was the realization that since the panel refuses to take focus, I can’t really use the keyboard with it. Yuck. The solution to that seems to involve changes to kwin, but I was busy and then that feature freeze snuck up and hit me over the head… so… no keyboard accessibility for the panel until 4.2 :(

There are some other things I was hoping to do that’ll have to wait until 4.2 as well. the most glaring omission is that you can’t configure the keyboard shortcuts. :/ sorry. I was so busy making them actually *work* that I didn’t have time to make them configurable, and since I bet that’d involve adding strings and other such non-freeze-compatible changes, I doubt I’d be allowed to do it while this damn freeze is in place. The next biggest thing is that we were planning to have shortcuts to jump to specific applets. that part kinda slipped my mind too, and I think it’s probably too late now. maybe it’d be possible for certain applets to put in hardcoded shortcuts (I’m thinking kickoff here) but you won’t see user-settable ones until 4.2.

Some of these shortcuts are discoverable by looking at contextmenus, but others are very well hidden. their default values are pretty arbitrary, too. so… well, here’s a list.

add widgets: ctrl-a
lock widgets: ctrl-l
zoom out: ctrl–
zoom in: ctrl-= or ctrl-+
next applet: ctrl-n
prev applet: ctrl-p
next containment: shift-ctrl-n
prev containment: shift-ctrl-p
applet settings: ctrl-s
containment settings: shift-ctrl-s (doesn’t work on the default containment yet. should be fixed soon.)
remove applet: ctrl-r
add activity: shift-ctrl-a

I really wish I’d been able to get more code written… but some keyboard accessibility is better than none. :)



{April 29, 2008}   plasma and the screensaver

so, this summer I’m gonna be putting plasma widgets on the screensaver. oh god, what have I got myself into?!

it’s gonna be pretty awesome… it just might take a few rather ugly hacks to get past X weirdness.

let’s start by quoting the scenarios from my soc proposal:

Amy wants to take her laptop to her lectures to play nethack — uh, I mean, take notes. She gets to class, unhibernates her laptop - then discovers she forgot to pause her music. Her laptop has no hardware volume control and the screen is locked, but since she always has a volume control on her screensaver, she reaches the mute button before anyone gets too annoyed.

Amy leaves to find a bathroom, and while she’s gone Bob leans over to see what’s on her computer. The screen is locked, so he can’t do any damage, but he leaves a rude message on the Notes widget anyways. Amy comes back and rolls her eyes at Bob’s bad spelling.

It’s the weekend, and Amy is having a party. She has all her music on her computer, and wants her friends to be able to pick songs, but doesn’t want Bob putting up nasty images like he did on Cory’s computer. She loads up the ‘party’ widgets she saved before, with a music widget and a few other toys, then leaves the screen locked.

Amy and her friends decide to go out for dinner. A few minutes after they leave, Amy’s roommate Dan comes home to find the music still blaring. He hits the stop button on the music widget, then logs into his own account and starts playing his own music.

so, what we’re going to have is basically a three-layer screensaver: layer 1 is the actual screensaver - the pretty animation. layer 2 is plasma - the widgets. layer 3 is the lock process - the bit that quietly makes sure the screen stays locked, offers a dialog to unlock it, and does some other invisible tie-things-together stuff. layer 2 is the only new bit here, of course.

naturally, there are some security concerns about putting something interactive on a locked screen. since something like this will never be 100% foolproof, it’ll be opt-in, and I’ll be making it as secure as it can reasonably be. plasma, like screensavers, will run in a separate process in case it crashes. plasma will be locked and unconfigurable unless the user enters their password to go into edit-mode. widgets will be tweaked to be aware of security restrictions and reduce their functionality when on the screensaver, then put on a whitelist, so users can only add safe plasmoids from the gui.

all this security infrastructure should end up helping plasma in general, and kiosk mode: when I’m done there should be a nice simple way for plasmoids to check what sort of features they should offer, and stay out of trouble. of course, bugs will happen - but that’s always a risk in any software.

unfortunately, the security also makes my life more difficult: running plasma out-of-process means *pain* in terms of both display and input. display was going to be a pain anyways - it might end up requiring composite to show the screensaver at the same time as plasma - but input, eeew. just to complicate it even more, that “this session is locked” dialog will probably stick around, because it has some fancy plugin ability that I don’t think I’ll have time to investigate.

so… lots of work to do, and I’ll probably run into all sorts of evil X things I never wanted to know. but when it’s done I’ll finally have that volume control on my screensaver! ;) and clocks, and notes, and maybe a photo, and, and… somuchstuff! :)



et cetera