0 00:00:00,000 --> 00:00:30,000 Dear viewer, these subtitles were generated by a machine via the service Trint and therefore are (very) buggy. If you are capable, please help us to create good quality subtitles: https://c3subtitles.de/talk/1411 Thanks! 1 00:00:18,400 --> 00:00:19,659 All right, welcome everybody. 2 00:00:20,710 --> 00:00:23,019 We're about to start the next talk, which 3 00:00:23,020 --> 00:00:25,239 is the one topic that I personally know 4 00:00:25,240 --> 00:00:27,609 very little of, so I'm really 5 00:00:27,610 --> 00:00:29,349 excited and looking forward to learn a 6 00:00:29,350 --> 00:00:31,539 bit about window managers, 7 00:00:31,540 --> 00:00:33,189 which is, you know, definitely 8 00:00:33,190 --> 00:00:35,349 interesting. So I'm 9 00:00:35,350 --> 00:00:37,779 very happy to introduce Rachel, 10 00:00:37,780 --> 00:00:38,830 who's going to talk about 11 00:00:39,850 --> 00:00:41,919 his self-written X11 window 12 00:00:41,920 --> 00:00:42,989 manager. 13 00:00:42,990 --> 00:00:45,069 Oh, and yeah, he's going to 14 00:00:45,070 --> 00:00:47,139 talk a little bit about his 15 00:00:47,140 --> 00:00:49,269 experience implementing it and what he 16 00:00:49,270 --> 00:00:50,709 learned on the way. 17 00:00:50,710 --> 00:00:52,249 So please welcome Rachel. 18 00:00:56,530 --> 00:00:58,739 Who want fancy? 19 00:00:58,740 --> 00:01:01,309 Hi, I'm Rettew, and 20 00:01:01,310 --> 00:01:03,289 this is this talk is basically terrifying 21 00:01:03,290 --> 00:01:05,449 me because this presentation 22 00:01:05,450 --> 00:01:06,889 is given with a software that I've 23 00:01:06,890 --> 00:01:07,890 written. So 24 00:01:09,060 --> 00:01:10,789 this is an early alpha state. 25 00:01:10,790 --> 00:01:11,790 So, yeah, 26 00:01:13,040 --> 00:01:14,629 pretty terrifying situation. 27 00:01:14,630 --> 00:01:16,279 Anyway, I'm going to talk a little bit 28 00:01:16,280 --> 00:01:18,919 about my experience of X11 29 00:01:18,920 --> 00:01:20,869 and Wayland and implementing Hikari, 30 00:01:20,870 --> 00:01:23,029 which is my window manager slash 31 00:01:23,030 --> 00:01:24,079 compositor. 32 00:01:24,080 --> 00:01:26,329 And another interesting thing about 33 00:01:26,330 --> 00:01:28,339 this topic basically spawns a lot of 34 00:01:28,340 --> 00:01:29,989 people that have a lot of opinions. 35 00:01:31,040 --> 00:01:33,259 It's kind of weird that people have very 36 00:01:33,260 --> 00:01:35,329 strong opinions on that, but maybe I can 37 00:01:35,330 --> 00:01:37,909 give you some interesting, maybe informed 38 00:01:37,910 --> 00:01:40,009 information about what's basically going 39 00:01:40,010 --> 00:01:41,209 on. 40 00:01:41,210 --> 00:01:43,429 So, yeah, I said this 41 00:01:43,430 --> 00:01:45,859 talk is a little bit about Hikari. 42 00:01:45,860 --> 00:01:47,419 I'm going to talk a little bit more about 43 00:01:47,420 --> 00:01:49,489 X11 and Wayland, but first of all, 44 00:01:49,490 --> 00:01:51,529 I want to tell you why I basically 45 00:01:51,530 --> 00:01:54,169 started doing what I did in the last 46 00:01:54,170 --> 00:01:55,159 one and a half years. 47 00:01:55,160 --> 00:01:57,259 So I wanted to build a 48 00:01:57,260 --> 00:01:59,809 window manager for some reason and 49 00:01:59,810 --> 00:02:01,039 later on a compositor. 50 00:02:01,040 --> 00:02:03,169 So I've been spending like the last one 51 00:02:03,170 --> 00:02:05,479 and a half years looking at X11, 52 00:02:05,480 --> 00:02:07,549 looking at Wayland, those 53 00:02:07,550 --> 00:02:09,559 different protocols and roughly spanning 54 00:02:09,560 --> 00:02:11,689 nine months working with each one 55 00:02:11,690 --> 00:02:13,909 of these. And so I've written 56 00:02:13,910 --> 00:02:15,769 this this whole window manager, which 57 00:02:15,770 --> 00:02:18,049 basically does things like moving 58 00:02:18,050 --> 00:02:20,359 your windows around, resizing them does 59 00:02:20,360 --> 00:02:22,519 displaying and all this stuff 60 00:02:22,520 --> 00:02:24,799 and makes makes you gives 61 00:02:24,800 --> 00:02:26,839 you abilities to manage your windows. 62 00:02:28,070 --> 00:02:30,229 So, yeah, I've written this thing from 63 00:02:30,230 --> 00:02:32,299 scratch, and I was largely inspired by 64 00:02:32,300 --> 00:02:34,619 things like C, W, M and Hertzel. 65 00:02:34,620 --> 00:02:37,309 Look them, so 66 00:02:37,310 --> 00:02:38,809 I wanted to have something that is 67 00:02:38,810 --> 00:02:39,769 keyboard driven. 68 00:02:39,770 --> 00:02:41,629 So I'm a vim user. 69 00:02:41,630 --> 00:02:44,059 I want to have shortcuts and 70 00:02:44,060 --> 00:02:45,199 fancy things for everything. 71 00:02:45,200 --> 00:02:47,119 I don't want to use my mouse, so I want 72 00:02:47,120 --> 00:02:49,159 to be able to do that. 73 00:02:49,160 --> 00:02:51,469 So fast navigation and stuff 74 00:02:51,470 --> 00:02:53,479 like that, and I want it to waste very 75 00:02:53,480 --> 00:02:55,459 little screen span. I will show you what 76 00:02:55,460 --> 00:02:56,389 I mean. 77 00:02:56,390 --> 00:02:58,639 So you have waste with 78 00:02:58,640 --> 00:03:00,229 very little screen space. 79 00:03:00,230 --> 00:03:02,719 So this is this is basically my esthetic. 80 00:03:02,720 --> 00:03:04,759 So this is this is a terminal and it has 81 00:03:04,760 --> 00:03:06,829 a one pixel border and every pixel 82 00:03:06,830 --> 00:03:08,239 means something. 83 00:03:08,240 --> 00:03:10,519 So the white border tells 84 00:03:10,520 --> 00:03:12,049 me this window has focused. 85 00:03:12,050 --> 00:03:13,819 That's basically all I want to know. 86 00:03:13,820 --> 00:03:16,069 All I want to see and 87 00:03:16,070 --> 00:03:17,869 I don't have title bars which consume a 88 00:03:17,870 --> 00:03:20,149 lot of stuff, except when I have title 89 00:03:20,150 --> 00:03:22,219 bar. So I built something like when I 90 00:03:22,220 --> 00:03:24,289 press mod, it shows me 91 00:03:24,290 --> 00:03:25,339 the information that I need. 92 00:03:25,340 --> 00:03:27,529 It's like, This is like fish, my 93 00:03:27,530 --> 00:03:28,609 shell. 94 00:03:28,610 --> 00:03:30,739 It's on the first workspace and it's 95 00:03:30,740 --> 00:03:32,239 in the group shelves. 96 00:03:32,240 --> 00:03:33,529 I can talk a little bit about what these 97 00:03:33,530 --> 00:03:36,449 groups mean, and I can see 98 00:03:36,450 --> 00:03:38,119 it tells me, OK, if this is the windows 99 00:03:38,120 --> 00:03:39,289 and window that has focus 100 00:03:40,430 --> 00:03:41,389 on. 101 00:03:41,390 --> 00:03:43,609 So this is inspired by CW M, which 102 00:03:43,610 --> 00:03:45,079 has this concept of groups. 103 00:03:45,080 --> 00:03:47,149 They can put windows inside of 104 00:03:47,150 --> 00:03:49,249 groups and display them independently. 105 00:03:49,250 --> 00:03:52,219 And you have groups one to nine, 106 00:03:52,220 --> 00:03:53,539 and I wanted to be able to have 107 00:03:53,540 --> 00:03:55,099 independent groups because I started 108 00:03:55,100 --> 00:03:56,989 using them as workspaces and which is 109 00:03:56,990 --> 00:03:58,819 kind of like defeats the purpose. 110 00:03:58,820 --> 00:04:00,919 But I wanted to be able to group 111 00:04:00,920 --> 00:04:03,049 windows together in 112 00:04:03,050 --> 00:04:05,089 an arbitrary way. So when you open 113 00:04:05,090 --> 00:04:07,309 another window and open another one, 114 00:04:07,310 --> 00:04:09,589 you can see that when I press not 115 00:04:09,590 --> 00:04:11,869 that these frames turn orange, that 116 00:04:11,870 --> 00:04:14,119 this this belongs to a group and I can 117 00:04:14,120 --> 00:04:16,389 cycle between windows inside of 118 00:04:16,390 --> 00:04:17,689 of of a group. 119 00:04:17,690 --> 00:04:19,819 And there's another 120 00:04:19,820 --> 00:04:21,379 thing like now I started to root Shell 121 00:04:21,380 --> 00:04:23,389 Group. This is a different, different 122 00:04:23,390 --> 00:04:26,269 group so I can cycle between the groups. 123 00:04:26,270 --> 00:04:27,919 So this is something that that I wanted 124 00:04:27,920 --> 00:04:29,989 to have for some reason, and 125 00:04:29,990 --> 00:04:32,989 it turned out to be very, very much. 126 00:04:32,990 --> 00:04:35,389 It's very much fits my workflow. 127 00:04:35,390 --> 00:04:37,969 So, yeah, I also 128 00:04:37,970 --> 00:04:39,979 I'm not a big fan of tiling, except when 129 00:04:39,980 --> 00:04:41,989 I want to arrange my views. 130 00:04:41,990 --> 00:04:44,449 And so I built something that 131 00:04:44,450 --> 00:04:46,549 works like houseless fam work and 132 00:04:46,550 --> 00:04:48,919 tile all these views and 133 00:04:48,920 --> 00:04:50,419 skim through them. 134 00:04:50,420 --> 00:04:52,939 And this is configurable so you can write 135 00:04:52,940 --> 00:04:55,489 your layouts in something that 136 00:04:55,490 --> 00:04:57,499 kind of resembles Jason. 137 00:04:57,500 --> 00:04:59,809 As you see, all of which is the universal 138 00:04:59,810 --> 00:05:01,729 configuration language which is used by 139 00:05:01,730 --> 00:05:02,839 FreeBSD BSD, by the way. 140 00:05:04,580 --> 00:05:05,580 Yeah. 141 00:05:06,010 --> 00:05:08,109 This is basically what drove me 142 00:05:08,110 --> 00:05:09,669 to do this, and I also wanted to have 143 00:05:09,670 --> 00:05:11,169 minimal dependencies. 144 00:05:11,170 --> 00:05:13,569 I have a very small set of libraries 145 00:05:13,570 --> 00:05:15,309 that I'm using and I want to be energy 146 00:05:15,310 --> 00:05:17,289 efficient. I try to be as energy 147 00:05:17,290 --> 00:05:19,479 efficient as possible because, 148 00:05:19,480 --> 00:05:21,969 yeah, it saves a lot of time. 149 00:05:21,970 --> 00:05:24,129 It gives you a lot of time with your 150 00:05:24,130 --> 00:05:25,599 with the computer because battery time 151 00:05:25,600 --> 00:05:26,949 increases drastically. 152 00:05:26,950 --> 00:05:28,509 And also, I wanted to talk it previously 153 00:05:28,510 --> 00:05:30,669 because that's the operating system that 154 00:05:30,670 --> 00:05:32,709 I'm using. I will I will at one point 155 00:05:32,710 --> 00:05:34,449 support Linux and other operating 156 00:05:34,450 --> 00:05:36,819 systems, but right now it's 157 00:05:36,820 --> 00:05:38,859 is FreeBSD BSD only. 158 00:05:38,860 --> 00:05:40,449 Yeah, so it has those two 159 00:05:40,450 --> 00:05:42,519 implementations. I wrote this thing 160 00:05:42,520 --> 00:05:45,039 basically twice, which 161 00:05:45,040 --> 00:05:46,839 spent twice the time on one thing. 162 00:05:46,840 --> 00:05:48,009 Why not? 163 00:05:48,010 --> 00:05:49,010 Yeah. 164 00:05:50,650 --> 00:05:52,839 So what were these different 165 00:05:52,840 --> 00:05:54,909 approaches? So we 166 00:05:54,910 --> 00:05:56,919 basically have X11, which most of you 167 00:05:56,920 --> 00:05:58,149 people probably know. 168 00:05:58,150 --> 00:06:00,339 And then we have this new thing like 10 169 00:06:00,340 --> 00:06:02,799 year old Wayland 170 00:06:02,800 --> 00:06:04,779 and both of both of these things are 171 00:06:04,780 --> 00:06:07,239 basically protocols like TCP. 172 00:06:07,240 --> 00:06:09,069 So it's a protocol that somewhat 173 00:06:09,070 --> 00:06:11,359 describes your your 174 00:06:11,360 --> 00:06:12,549 your applications. 175 00:06:12,550 --> 00:06:13,639 I want to look like this. 176 00:06:13,640 --> 00:06:15,819 I want to work with events in a certain 177 00:06:15,820 --> 00:06:18,099 way. And there 178 00:06:18,100 --> 00:06:19,869 are certain implementations like the xorg 179 00:06:19,870 --> 00:06:22,269 server, and there's also 180 00:06:22,270 --> 00:06:23,739 the suelen thing that I'm going to talk 181 00:06:23,740 --> 00:06:25,119 about. But first, let's talk a little bit 182 00:06:25,120 --> 00:06:26,920 about X here 183 00:06:28,360 --> 00:06:30,399 and the X window system, which is the 184 00:06:30,400 --> 00:06:31,509 implementation that most of you are 185 00:06:31,510 --> 00:06:33,159 probably using, except when you're using 186 00:06:33,160 --> 00:06:35,409 recent Gnome, which is 187 00:06:35,410 --> 00:06:37,059 Wayland by default. 188 00:06:37,060 --> 00:06:39,069 So let's think thing looks like this. 189 00:06:39,070 --> 00:06:41,229 So we have the kernel, we have to 190 00:06:41,230 --> 00:06:42,399 scramble settings stuff. 191 00:06:42,400 --> 00:06:44,919 We have F2F, which gives your 192 00:06:44,920 --> 00:06:46,479 keyboard, mouse events and stuff like 193 00:06:46,480 --> 00:06:47,480 that. 194 00:06:47,950 --> 00:06:50,199 And in the middle, we have this X server 195 00:06:50,200 --> 00:06:52,239 and basically responsible for rendering 196 00:06:52,240 --> 00:06:53,709 all the stuff. 197 00:06:53,710 --> 00:06:55,209 And then we have a bunch of clients up 198 00:06:55,210 --> 00:06:57,069 there. So this could be a terminal. 199 00:06:57,070 --> 00:06:59,259 This could be our screen locker 200 00:06:59,260 --> 00:07:00,909 and your window manager because your 201 00:07:00,910 --> 00:07:02,469 window manager is basically just the 202 00:07:02,470 --> 00:07:03,579 client to the X server. 203 00:07:05,350 --> 00:07:07,629 It's kind of like that, and this step is 204 00:07:07,630 --> 00:07:09,849 optional. It's what 205 00:07:09,850 --> 00:07:12,009 recently, maybe like 10 206 00:07:12,010 --> 00:07:14,319 years ago, or even more 15 years ago, 207 00:07:14,320 --> 00:07:16,959 they added this compositing thing. 208 00:07:16,960 --> 00:07:19,119 So when you 209 00:07:19,120 --> 00:07:22,239 press a button to generate an event, 210 00:07:22,240 --> 00:07:23,759 the server pick itself was client. 211 00:07:23,760 --> 00:07:25,599 It goes to sense that once with the 212 00:07:25,600 --> 00:07:27,609 client, the client does things. 213 00:07:27,610 --> 00:07:29,739 It figures out how it wants to 214 00:07:29,740 --> 00:07:32,679 look like census gets to the server, 215 00:07:32,680 --> 00:07:34,899 then the X server sense 216 00:07:34,900 --> 00:07:36,939 things. The compositor compositor 217 00:07:36,940 --> 00:07:39,279 Manchester everything together and 218 00:07:39,280 --> 00:07:40,689 brings that back to the server, and the 219 00:07:40,690 --> 00:07:42,099 server basically displays all the stuff. 220 00:07:42,100 --> 00:07:43,809 So you have a lot of things going on 221 00:07:43,810 --> 00:07:44,810 here. 222 00:07:45,370 --> 00:07:47,529 And yeah, this you can see there 223 00:07:47,530 --> 00:07:49,269 are a lot of processes involved and a lot 224 00:07:49,270 --> 00:07:50,469 of communication between all of these 225 00:07:50,470 --> 00:07:51,470 things. 226 00:07:52,330 --> 00:07:53,769 So what does the window manager look 227 00:07:53,770 --> 00:07:56,319 like? This is like the most simple 228 00:07:56,320 --> 00:07:57,999 implementation that I found. 229 00:07:58,000 --> 00:08:00,159 It's tiny w m written 230 00:08:00,160 --> 00:08:02,469 by Nick Welch, and 231 00:08:02,470 --> 00:08:04,089 it's it fits a slide. 232 00:08:04,090 --> 00:08:05,229 I don't know if you can read that you 233 00:08:05,230 --> 00:08:07,329 shouldn't, but just to 234 00:08:07,330 --> 00:08:09,489 give you an impression of 235 00:08:09,490 --> 00:08:11,469 how easy it is to getting started with 236 00:08:11,470 --> 00:08:12,579 the window manager. 237 00:08:12,580 --> 00:08:15,099 I basically have my first working 238 00:08:15,100 --> 00:08:17,589 implementation of Hikari after a week 239 00:08:17,590 --> 00:08:19,659 and I started using it on a daily basis 240 00:08:19,660 --> 00:08:22,029 after that, which I think is 241 00:08:22,030 --> 00:08:23,439 kind of impressive because the platform 242 00:08:23,440 --> 00:08:26,259 gives you so much, so many mechanisms 243 00:08:26,260 --> 00:08:28,509 that it provides that you basically 244 00:08:28,510 --> 00:08:29,709 have everything in your server. 245 00:08:29,710 --> 00:08:31,839 And, yeah, got a lot 246 00:08:31,840 --> 00:08:32,840 of the stuff for free. 247 00:08:36,010 --> 00:08:38,139 So now I want to be able to 248 00:08:38,140 --> 00:08:40,119 talk to, as I said, it's talk to the X 249 00:08:40,120 --> 00:08:42,279 server. I said it's a protocol and there 250 00:08:42,280 --> 00:08:43,298 are different ways to speak. 251 00:08:43,299 --> 00:08:45,369 The X server and the 252 00:08:45,370 --> 00:08:48,159 old way of like the old people did, 253 00:08:48,160 --> 00:08:49,929 called X Slip. 254 00:08:49,930 --> 00:08:52,239 And it's all these all these API 255 00:08:52,240 --> 00:08:54,339 calls are pretty, pretty synchronous, 256 00:08:54,340 --> 00:08:56,409 you write a request, then 257 00:08:56,410 --> 00:08:57,639 you wait. 258 00:08:57,640 --> 00:09:00,159 Then you read the response 259 00:09:00,160 --> 00:09:02,149 and over and over again, you do that. 260 00:09:02,150 --> 00:09:04,419 And so you can see you waste 261 00:09:04,420 --> 00:09:06,099 a lot of time wasting. 262 00:09:06,100 --> 00:09:07,809 A lot of applications are really waiting 263 00:09:07,810 --> 00:09:09,969 like a long time before the 264 00:09:09,970 --> 00:09:10,929 actual response. 265 00:09:10,930 --> 00:09:12,039 Kind of annoying. 266 00:09:12,040 --> 00:09:14,169 So people came up with ex-hubby, 267 00:09:14,170 --> 00:09:15,639 which is the foundation of a lot of 268 00:09:15,640 --> 00:09:16,879 things that so excellent. 269 00:09:16,880 --> 00:09:19,689 This basically built around this thing. 270 00:09:19,690 --> 00:09:22,419 But with with XIV, you can 271 00:09:22,420 --> 00:09:24,729 fly. Right, right, right, right. 272 00:09:24,730 --> 00:09:26,559 Then wait for the responses and just 273 00:09:26,560 --> 00:09:28,929 consume all these responses, which 274 00:09:28,930 --> 00:09:30,009 is a lot faster. 275 00:09:30,010 --> 00:09:32,139 And I went with with this Zibi, and 276 00:09:32,140 --> 00:09:34,209 it gave me a sort of really 277 00:09:34,210 --> 00:09:36,429 fluffy window managers 278 00:09:36,430 --> 00:09:38,679 feeling compared to 279 00:09:38,680 --> 00:09:39,999 others that we're using. 280 00:09:40,000 --> 00:09:41,000 Excellent. 281 00:09:41,530 --> 00:09:42,789 So, yeah, I went that way. 282 00:09:45,640 --> 00:09:47,919 So now one, I have to pack 283 00:09:47,920 --> 00:09:49,629 a lot of stuff. So I'm hopefully I'm not 284 00:09:49,630 --> 00:09:50,919 going to fast forward. So I want to talk 285 00:09:50,920 --> 00:09:52,809 a little bit about the some interesting 286 00:09:52,810 --> 00:09:55,179 things that I I discovered 287 00:09:55,180 --> 00:09:57,519 when working with with X.. 288 00:09:57,520 --> 00:09:59,659 So let's think about how I order 289 00:09:59,660 --> 00:10:01,179 windows in a stacking window manager. 290 00:10:01,180 --> 00:10:03,009 So I basically put them on top of each 291 00:10:03,010 --> 00:10:04,959 other and then the service to render 292 00:10:04,960 --> 00:10:07,179 them. So certainly you need 293 00:10:07,180 --> 00:10:09,369 to have some sort of ordering there 294 00:10:09,370 --> 00:10:11,199 in which order the windows. 295 00:10:11,200 --> 00:10:13,329 We know the service rendering 296 00:10:13,330 --> 00:10:15,459 them and you want to cycle through 297 00:10:15,460 --> 00:10:16,659 them. 298 00:10:16,660 --> 00:10:18,999 So these I have this concept of this 299 00:10:19,000 --> 00:10:21,069 of these groups that I showed you, and 300 00:10:21,070 --> 00:10:22,809 the explorer has no idea about them. 301 00:10:22,810 --> 00:10:24,819 So it doesn't know when I say, go to the 302 00:10:24,820 --> 00:10:27,429 next window, I can do that because 303 00:10:27,430 --> 00:10:29,109 it doesn't know what groups are. 304 00:10:29,110 --> 00:10:31,419 So what I had to do is essentially 305 00:10:31,420 --> 00:10:32,409 at re-implement. 306 00:10:32,410 --> 00:10:34,299 All this functionality in my window meant 307 00:10:34,300 --> 00:10:36,759 I to and synchronize them. 308 00:10:36,760 --> 00:10:38,679 The X server now has an ordering of 309 00:10:38,680 --> 00:10:40,539 windows and my window manager has an 310 00:10:40,540 --> 00:10:42,369 ordering of windows, and I'm not the only 311 00:10:42,370 --> 00:10:43,689 one doing that. 312 00:10:43,690 --> 00:10:45,039 Basically, every other limitation I 313 00:10:45,040 --> 00:10:47,229 looked at of the modern, 314 00:10:47,230 --> 00:10:49,539 modern window managers. 315 00:10:49,540 --> 00:10:51,879 They were all doing the same thing. 316 00:10:51,880 --> 00:10:53,979 I had to reinvent the wheel, 317 00:10:53,980 --> 00:10:55,959 basically, which is a bit of a bit 318 00:10:55,960 --> 00:10:56,960 annoying. 319 00:10:57,790 --> 00:11:00,489 And that was another thing. 320 00:11:00,490 --> 00:11:02,649 Just think about, I want 321 00:11:02,650 --> 00:11:03,820 to move this window to up. 322 00:11:06,320 --> 00:11:09,009 Well, the thing is that the server, 323 00:11:09,010 --> 00:11:11,709 basically it has just one giant buffer 324 00:11:11,710 --> 00:11:13,899 and then your your 325 00:11:13,900 --> 00:11:16,089 client just sent some primitives 326 00:11:16,090 --> 00:11:18,219 to the X server and it draws 327 00:11:18,220 --> 00:11:19,119 things there. 328 00:11:19,120 --> 00:11:21,129 So it just sits in one buffer. 329 00:11:21,130 --> 00:11:23,259 And maybe you've seen this if you 330 00:11:23,260 --> 00:11:25,869 raise this window, then this portion 331 00:11:27,070 --> 00:11:28,779 of the screen needs to get redrawn. 332 00:11:28,780 --> 00:11:31,149 And so what the X server does, it sends 333 00:11:31,150 --> 00:11:33,339 an expose of N to Window 334 00:11:33,340 --> 00:11:35,799 two to the client of Window two, 335 00:11:35,800 --> 00:11:38,079 and then it generates 336 00:11:38,080 --> 00:11:40,449 all these primitives like write 337 00:11:40,450 --> 00:11:43,029 a line and draw a circle and 338 00:11:43,030 --> 00:11:44,559 draw some text over there. 339 00:11:44,560 --> 00:11:46,059 And it's this redraw them. 340 00:11:46,060 --> 00:11:48,129 So you sometimes you really see this 341 00:11:48,130 --> 00:11:50,019 effect where when your computer's on 342 00:11:50,020 --> 00:11:52,449 power man has meant that you can watch 343 00:11:52,450 --> 00:11:55,539 it redraw itself and this 344 00:11:55,540 --> 00:11:57,639 kind of like learn to accept that. 345 00:11:57,640 --> 00:11:59,949 But yes, it gets 346 00:11:59,950 --> 00:12:02,379 better with compositing, but 347 00:12:02,380 --> 00:12:04,089 it's still not pretty. 348 00:12:04,090 --> 00:12:06,249 It's really something that 349 00:12:06,250 --> 00:12:07,929 annoyed me at some point. 350 00:12:07,930 --> 00:12:10,089 And with modern and 351 00:12:10,090 --> 00:12:12,039 with modern toolkits, it's even why they 352 00:12:12,040 --> 00:12:14,139 basically draw everything in her pics 353 00:12:14,140 --> 00:12:16,119 map and had this pix map over to the to 354 00:12:16,120 --> 00:12:17,829 the XOR events. I draw this, but don't 355 00:12:17,830 --> 00:12:19,719 touch a drop to start point. 356 00:12:19,720 --> 00:12:21,789 And you can think about how 357 00:12:21,790 --> 00:12:23,919 much, how much 358 00:12:23,920 --> 00:12:25,429 traffic you can generate when you have. 359 00:12:25,430 --> 00:12:28,389 Like this giant pix map and on my screen 360 00:12:28,390 --> 00:12:30,489 resolution, one frame of 361 00:12:30,490 --> 00:12:32,139 the entire scenario basically like 10 362 00:12:32,140 --> 00:12:34,339 megabytes. And let's talk about 363 00:12:34,340 --> 00:12:35,829 network transparency here. 364 00:12:35,830 --> 00:12:37,629 That's an interesting thing to think 365 00:12:37,630 --> 00:12:39,789 about, but yeah, this is basically 366 00:12:39,790 --> 00:12:40,790 what happens. 367 00:12:41,470 --> 00:12:43,929 And this was kind of annoying 368 00:12:43,930 --> 00:12:46,179 thing with extra cover. 369 00:12:46,180 --> 00:12:48,189 And another thing so this is code from I 370 00:12:48,190 --> 00:12:49,899 don't know if you read the comment, this 371 00:12:49,900 --> 00:12:51,340 code from awesome that I saw 372 00:12:52,570 --> 00:12:54,939 as before, I said that 373 00:12:54,940 --> 00:12:57,159 the client is the X window 374 00:12:57,160 --> 00:12:58,329 manager and the window manager is 375 00:12:58,330 --> 00:13:00,339 basically just a client. 376 00:13:00,340 --> 00:13:02,619 And what sometimes had you asked 377 00:13:02,620 --> 00:13:04,689 for a keyboard? 378 00:13:04,690 --> 00:13:06,819 Like when I open 379 00:13:06,820 --> 00:13:08,979 a view and I want 380 00:13:08,980 --> 00:13:11,139 to change the group it's 381 00:13:11,140 --> 00:13:13,119 in and I want to be able to type stuff 382 00:13:13,120 --> 00:13:14,170 here, type. 383 00:13:15,370 --> 00:13:17,439 And so after all those keyboard 384 00:13:17,440 --> 00:13:19,539 inputs, when he goes, I want to 385 00:13:20,560 --> 00:13:23,589 like get all, get all the screen events, 386 00:13:23,590 --> 00:13:25,749 get all keyboard events and write that 387 00:13:25,750 --> 00:13:26,829 into a buffer. 388 00:13:26,830 --> 00:13:29,349 So this is something I saw in awesome 389 00:13:29,350 --> 00:13:31,419 and awesome. It's basically like 390 00:13:31,420 --> 00:13:33,579 begging the observer, Give me that 391 00:13:33,580 --> 00:13:34,779 keyboard. 392 00:13:34,780 --> 00:13:36,399 It's doing that for a thousand times. 393 00:13:36,400 --> 00:13:37,779 Then it waits for a millisecond, so it 394 00:13:37,780 --> 00:13:39,399 basically tries for a second to please 395 00:13:39,400 --> 00:13:40,659 give me that resource. 396 00:13:40,660 --> 00:13:42,459 Even though the window manager should be 397 00:13:42,460 --> 00:13:44,919 the thing in charts, it's basically 398 00:13:44,920 --> 00:13:46,229 begging for resources. 399 00:13:46,230 --> 00:13:48,429 And this this felt wrong 400 00:13:48,430 --> 00:13:51,119 when I wrote a. But yeah, it's also 401 00:13:51,120 --> 00:13:53,249 what most middle managers seem to 402 00:13:53,250 --> 00:13:54,599 deal with here. 403 00:13:54,600 --> 00:13:55,949 That's that's a problem when you have a 404 00:13:55,950 --> 00:13:56,950 middle man. 405 00:13:57,660 --> 00:13:59,819 Yeah, and this is so 406 00:13:59,820 --> 00:14:01,899 with the conclusion of when 407 00:14:01,900 --> 00:14:04,259 I implement an ex, I basically 408 00:14:04,260 --> 00:14:06,149 said, OK, well, it's really easy to come 409 00:14:06,150 --> 00:14:07,709 up with a window manager. 410 00:14:07,710 --> 00:14:09,899 It's just like takes a week to get 411 00:14:09,900 --> 00:14:12,509 something roughly working. 412 00:14:12,510 --> 00:14:14,579 And yeah, but all these 413 00:14:14,580 --> 00:14:16,259 graphical user interfaces, they kind of 414 00:14:16,260 --> 00:14:18,389 evolve. They all basically all through 415 00:14:18,390 --> 00:14:20,909 off off screen rendering, 416 00:14:20,910 --> 00:14:22,499 then just shove around picks, maps and 417 00:14:22,500 --> 00:14:23,849 stuff like that. 418 00:14:23,850 --> 00:14:26,069 Maybe there could be something 419 00:14:26,070 --> 00:14:27,509 better. You have a gazillion of 420 00:14:27,510 --> 00:14:29,129 extensions. 421 00:14:29,130 --> 00:14:30,130 That's also fun 422 00:14:31,440 --> 00:14:33,569 because at one point you 423 00:14:33,570 --> 00:14:34,979 will discover a client that will use an 424 00:14:34,980 --> 00:14:36,539 extension that you never run off before, 425 00:14:36,540 --> 00:14:37,799 and it will do something weird, 426 00:14:39,180 --> 00:14:40,109 which is also fun. 427 00:14:40,110 --> 00:14:41,639 And then you have to look up and all of 428 00:14:41,640 --> 00:14:42,989 these other different window managers how 429 00:14:42,990 --> 00:14:43,919 they are dealing with it. 430 00:14:43,920 --> 00:14:45,780 And it's it's not free. 431 00:14:48,090 --> 00:14:50,789 And X is a global namespace 432 00:14:50,790 --> 00:14:52,859 like every client at every point 433 00:14:52,860 --> 00:14:54,869 in time, can become a key logger, can 434 00:14:54,870 --> 00:14:57,299 become a screen recorder and just like 435 00:14:57,300 --> 00:14:58,799 send your stuff over the wire, 436 00:15:00,240 --> 00:15:01,379 you can have a lot of fun with that, 437 00:15:01,380 --> 00:15:02,380 believe me. 438 00:15:03,390 --> 00:15:05,279 So from a security standpoint, that's. 439 00:15:06,470 --> 00:15:07,470 Not go. 440 00:15:09,080 --> 00:15:10,759 Yeah, the window manager is the client 441 00:15:10,760 --> 00:15:12,679 that's the back for things like the mouse 442 00:15:12,680 --> 00:15:14,179 or keyboard. 443 00:15:14,180 --> 00:15:15,919 So and you also duplicate a lot of 444 00:15:15,920 --> 00:15:17,479 functionality and you have ugly screen 445 00:15:17,480 --> 00:15:19,729 artifacts. So I was basically a bit fed 446 00:15:19,730 --> 00:15:21,709 up with this and thought, well, there is 447 00:15:21,710 --> 00:15:24,649 this new new thing called Weyland. 448 00:15:24,650 --> 00:15:26,779 So why not look at that as well 449 00:15:26,780 --> 00:15:29,569 and see how that works? 450 00:15:29,570 --> 00:15:31,130 So this is the architecture of Wayland, 451 00:15:32,180 --> 00:15:34,489 and we basically just take out the 452 00:15:34,490 --> 00:15:36,559 entire compositor of the 453 00:15:36,560 --> 00:15:37,969 entire thing. 454 00:15:37,970 --> 00:15:39,979 And now we just have clients and all 455 00:15:39,980 --> 00:15:42,379 these clients through a screen buffering. 456 00:15:42,380 --> 00:15:43,969 And now the client just said, Hey, use 457 00:15:43,970 --> 00:15:46,219 this buffer and we all use shared memory 458 00:15:46,220 --> 00:15:48,199 here. So it's not going over the wire or 459 00:15:48,200 --> 00:15:50,299 anything like just right 460 00:15:50,300 --> 00:15:51,499 into this buffer. And then I tell the 461 00:15:51,500 --> 00:15:53,839 compositor, Please display this and 462 00:15:53,840 --> 00:15:55,999 the capacitor takes care of all the input 463 00:15:56,000 --> 00:15:57,589 events, so I don't have to beg for my 464 00:15:57,590 --> 00:15:59,539 keyboard anymore. The compositor controls 465 00:15:59,540 --> 00:16:01,789 it, which also makes this 466 00:16:01,790 --> 00:16:03,829 from a security standpoint, is a lot more 467 00:16:03,830 --> 00:16:05,959 interesting because now you can say, 468 00:16:05,960 --> 00:16:07,579 OK, I will just deliver this keyboard 469 00:16:07,580 --> 00:16:09,259 event to this client. 470 00:16:09,260 --> 00:16:10,789 The other ones don't see that and the 471 00:16:10,790 --> 00:16:12,499 other ones think they are perfect. 472 00:16:12,500 --> 00:16:14,539 The only things that exist in the 473 00:16:14,540 --> 00:16:16,939 universe like this is real UI 474 00:16:16,940 --> 00:16:18,079 is isolation. 475 00:16:18,080 --> 00:16:20,179 You cannot build something that 476 00:16:20,180 --> 00:16:22,459 records the content of your of 477 00:16:22,460 --> 00:16:24,289 any other screens, which is pretty 478 00:16:24,290 --> 00:16:25,290 awesome. 479 00:16:27,160 --> 00:16:29,380 And every frame is perfect. 480 00:16:30,520 --> 00:16:32,589 This is really something that 481 00:16:32,590 --> 00:16:34,239 came to reality. 482 00:16:34,240 --> 00:16:36,339 Whalen really revolves around the 483 00:16:36,340 --> 00:16:37,749 notion of a frame. 484 00:16:37,750 --> 00:16:40,149 It's like, you know, when 485 00:16:40,150 --> 00:16:42,759 the compositor decides 486 00:16:42,760 --> 00:16:44,649 when to redraw things, it's not like draw 487 00:16:44,650 --> 00:16:47,229 a line, draw a circle, draw some text and 488 00:16:47,230 --> 00:16:49,059 in between, I could just draw a frame and 489 00:16:49,060 --> 00:16:50,869 flicker and do screen tearing and all 490 00:16:50,870 --> 00:16:52,599 this stuff. This just doesn't happen with 491 00:16:52,600 --> 00:16:54,759 Weyland. Everything is like super smooth. 492 00:16:54,760 --> 00:16:56,109 It's real. 493 00:16:56,110 --> 00:16:57,669 You don't want to go back when you see 494 00:16:57,670 --> 00:16:59,829 that once it's 495 00:16:59,830 --> 00:17:01,329 pretty impressive. 496 00:17:01,330 --> 00:17:03,579 So and there's also stuff 497 00:17:03,580 --> 00:17:04,568 like damage tracking. 498 00:17:04,569 --> 00:17:06,159 And if you want to read more about how 499 00:17:06,160 --> 00:17:08,259 Weyland and Welwyn compositions can 500 00:17:08,260 --> 00:17:10,239 do things, I really encourage you to read 501 00:17:10,240 --> 00:17:12,879 that blog post by Emerson 502 00:17:12,880 --> 00:17:13,929 probably butcher this name. 503 00:17:13,930 --> 00:17:16,088 Sorry for that, but 504 00:17:16,089 --> 00:17:17,618 that's that's really interesting stuff. 505 00:17:17,619 --> 00:17:18,880 I have to hurry a little bit here. 506 00:17:20,319 --> 00:17:22,449 So how did I write 507 00:17:22,450 --> 00:17:23,499 this thing? 508 00:17:23,500 --> 00:17:25,389 Obviously, I need to be able to write 509 00:17:25,390 --> 00:17:27,669 this well and practical stuff, so I just 510 00:17:27,670 --> 00:17:29,799 use our roots, which is the 511 00:17:29,800 --> 00:17:31,989 foundation for sway, which 512 00:17:31,990 --> 00:17:34,149 is basically a three four Weyland 513 00:17:34,150 --> 00:17:36,189 as like the 50000 lines of code you need 514 00:17:36,190 --> 00:17:38,169 to write anyway. So I thought, Yeah, I 515 00:17:38,170 --> 00:17:39,400 don't want to write those. Thank you. 516 00:17:41,380 --> 00:17:42,609 And I use that thing. 517 00:17:42,610 --> 00:17:44,919 And it's basically 518 00:17:44,920 --> 00:17:46,689 now for a lot of compositor. 519 00:17:46,690 --> 00:17:48,999 It's it's the foundation and 520 00:17:49,000 --> 00:17:51,399 it's it's very well-written 521 00:17:51,400 --> 00:17:53,799 stuff, so you should check that out. 522 00:17:53,800 --> 00:17:55,689 But it was released after I started 523 00:17:55,690 --> 00:17:57,099 working on the implementation. 524 00:17:57,100 --> 00:17:59,199 So no harm done 525 00:17:59,200 --> 00:18:00,249 here. 526 00:18:00,250 --> 00:18:02,529 And I want to look at the most simple 527 00:18:02,530 --> 00:18:03,489 Wayland compositor. 528 00:18:03,490 --> 00:18:05,649 They can look at tiny chips 529 00:18:05,650 --> 00:18:07,899 with roots to around 530 00:18:07,900 --> 00:18:09,429 a thousand lines of code. 531 00:18:09,430 --> 00:18:11,529 That sounds like a lot, but keep in mind 532 00:18:11,530 --> 00:18:13,569 that's a compositor that's server and a 533 00:18:13,570 --> 00:18:16,659 window manager like three things in one. 534 00:18:16,660 --> 00:18:18,999 And there's also something interesting 535 00:18:19,000 --> 00:18:21,159 to look at if you want to learn, like, 536 00:18:21,160 --> 00:18:22,749 have different resources, it's like a 537 00:18:22,750 --> 00:18:25,329 kiosk thing for Wayland. 538 00:18:25,330 --> 00:18:26,769 It's also use double yellow routes 539 00:18:28,180 --> 00:18:30,219 and basically all of these toolkits that 540 00:18:30,220 --> 00:18:31,929 you see. They all support Wayland out of 541 00:18:31,930 --> 00:18:34,029 the box, save your client's 542 00:18:34,030 --> 00:18:36,129 written decay or cut or 543 00:18:36,130 --> 00:18:37,359 clutter, whatever that is. 544 00:18:38,620 --> 00:18:41,539 I'm uneducated. I don't know NSDL. 545 00:18:41,540 --> 00:18:44,199 They all have Wayland backgrounds now, so 546 00:18:44,200 --> 00:18:45,969 you can basically switch transparently 547 00:18:45,970 --> 00:18:47,919 switch to all these things without even 548 00:18:47,920 --> 00:18:49,810 noticing, which I found was pretty neat. 549 00:18:51,100 --> 00:18:52,209 Firefox works. 550 00:18:52,210 --> 00:18:53,889 Thunderbird works. Just set this 551 00:18:53,890 --> 00:18:54,789 environment variable. 552 00:18:54,790 --> 00:18:56,919 It's a bit flaky at times, so I'm kind 553 00:18:56,920 --> 00:18:58,899 of glad this thing didn't crash. 554 00:18:58,900 --> 00:19:00,729 It doesn't crash that often, but could 555 00:19:00,730 --> 00:19:02,680 happen in the worst, worst of times. 556 00:19:03,700 --> 00:19:05,680 There's a video player and 557 00:19:06,940 --> 00:19:08,799 a clipboard makes my neo am happy. 558 00:19:08,800 --> 00:19:10,329 And if you want to be able to have X 559 00:19:10,330 --> 00:19:12,489 applications, you can do this with X 560 00:19:12,490 --> 00:19:13,490 Whalen. 561 00:19:14,390 --> 00:19:16,509 So, yeah, I had to 562 00:19:16,510 --> 00:19:17,529 hurry here a little bit. 563 00:19:18,550 --> 00:19:20,409 Basically, it's a lot less complexity and 564 00:19:20,410 --> 00:19:22,449 looks way better. 565 00:19:22,450 --> 00:19:23,859 There was a lot of cool stuff going on 566 00:19:23,860 --> 00:19:24,860 there. 567 00:19:26,110 --> 00:19:28,299 Yeah, apps roughly around 568 00:19:28,300 --> 00:19:30,189 the same time, the same amount of code 569 00:19:30,190 --> 00:19:31,809 here, which I think is pretty neat 570 00:19:31,810 --> 00:19:33,249 because it does so much more. 571 00:19:33,250 --> 00:19:35,199 You have more responsibilities, things 572 00:19:35,200 --> 00:19:36,339 like screen lockers, you have to 573 00:19:36,340 --> 00:19:37,509 implement that. 574 00:19:37,510 --> 00:19:39,729 So now you wonder what kind of programing 575 00:19:39,730 --> 00:19:41,529 language do they use to implement this? 576 00:19:41,530 --> 00:19:43,599 And this probably divides 577 00:19:43,600 --> 00:19:44,529 the room into J. 578 00:19:44,530 --> 00:19:45,530 And Oh. 579 00:19:46,300 --> 00:19:48,309 But I basically did this for good 580 00:19:48,310 --> 00:19:50,469 reasons. Like I said before, it's fifty 581 00:19:50,470 --> 00:19:52,689 thousand lines of Code C and 582 00:19:52,690 --> 00:19:54,789 the while the people trying to do that in 583 00:19:54,790 --> 00:19:56,979 rust and they basically 584 00:19:56,980 --> 00:19:58,959 said, OK, it's too hard. 585 00:19:58,960 --> 00:20:00,309 We can't do that. 586 00:20:00,310 --> 00:20:02,529 This is from the way cooler 587 00:20:02,530 --> 00:20:04,720 compositor, which is awesome and Wayland. 588 00:20:06,640 --> 00:20:08,799 And they basically said, OK, we 589 00:20:08,800 --> 00:20:10,929 can't do this. It's too much work and I 590 00:20:10,930 --> 00:20:12,909 don't want to rewrite 50000 lines of code 591 00:20:12,910 --> 00:20:13,989 in rust. 592 00:20:13,990 --> 00:20:15,399 I basically don't have the time for that, 593 00:20:15,400 --> 00:20:16,719 even though it will be probably 594 00:20:16,720 --> 00:20:17,720 interesting to do so. 595 00:20:18,610 --> 00:20:20,709 So, yeah, I did 596 00:20:20,710 --> 00:20:21,999 address sanitizing. 597 00:20:22,000 --> 00:20:23,499 This is a very cool thing to check. 598 00:20:23,500 --> 00:20:25,719 You are if you have things like double 599 00:20:25,720 --> 00:20:26,720 freeze or 600 00:20:28,120 --> 00:20:29,559 use up to freeze. 601 00:20:29,560 --> 00:20:30,759 Sounds pretty cool. 602 00:20:30,760 --> 00:20:32,649 And I used a lot of the trace I can show 603 00:20:32,650 --> 00:20:34,329 you the strip later on. 604 00:20:34,330 --> 00:20:35,889 That basically keeps track of all the 605 00:20:35,890 --> 00:20:37,539 memory applications that I have set on 606 00:20:37,540 --> 00:20:38,859 memory. 607 00:20:38,860 --> 00:20:40,929 So yeah, it's basically if if you want to 608 00:20:40,930 --> 00:20:42,849 get a hold of me on a mastodon, I'm on 609 00:20:42,850 --> 00:20:43,869 Matrix. 610 00:20:43,870 --> 00:20:46,209 You can write an email to me or just join 611 00:20:46,210 --> 00:20:48,519 our Hikari chat room and 612 00:20:48,520 --> 00:20:50,289 or get in contact with me at the main 613 00:20:50,290 --> 00:20:52,269 assembly. Thank you. 614 00:20:52,270 --> 00:20:53,270 Right on time.