Skip to content

Commit

Permalink
os: add graphical terminal screenshot
Browse files Browse the repository at this point in the history
- wm: update z_index for unfocused windows
- core: fix echo's output
  • Loading branch information
ffwff committed Sep 10, 2019
1 parent 761363b commit b9c63f4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1 align="center">lilith</h1>

<p align="center">
<img src="./img/screenshot-wm.png" alt="screenshot of lilith"/>
<img src="./img/screenshot-terms.png" alt="screenshot of lilith"/>
</p>

<p align="center">
Expand Down
Binary file added img/screenshot-terms.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions userspace/applications/core/echo.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#include <stdio.h>

int main(int argc, char **argv) {
for(int i = 1; i < argc; i++) {
printf("%s", argv[i]);
for(int i = 1; i < argc - 1; i++) {
printf("%s ", argv[i]);
}
if (argc > 0)
printf("%s\n", argv[argc - 1]);
return 0;
}
11 changes: 6 additions & 5 deletions userspace/applications/wm/wm.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,12 @@ int main(int argc, char **argv) {
int old_wid = wm.focused_wid;
struct wm_window *focused_win = NULL;
for(int i = wm.nwindows; i >= 0; i--) {
if (wm.windows[i].type == WM_WINDOW_PROG &&
point_in_win_prog(&wm.windows[i].as.prog, sprite->x, sprite->y)) {
wm.focused_wid = wm.windows[i].wid;
focused_win = &wm.windows[i];
break;
if (wm.windows[i].type == WM_WINDOW_PROG) {
if(point_in_win_prog(&wm.windows[i].as.prog, sprite->x, sprite->y) && !focused_win) {
wm.focused_wid = wm.windows[i].wid;
focused_win = &wm.windows[i];
}
wm.windows[i].z_index = 1;
}
}
if(old_wid != wm.focused_wid && focused_win) {
Expand Down

0 comments on commit b9c63f4

Please sign in to comment.