MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / PollCommands

Method PollCommands

Applications/Shell/shell.cpp:21–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20extern bool paintTaskbar;
21void ShellInstance::PollCommands(){
22 handle_t client;
23 Lemon::Message m;
24 while(shellSrv.Poll(client, m)){
25 paintTaskbar = true;
26 if(m.id() == Lemon::MessagePeerDisconnect){ // Disconnected
27 continue;
28 }
29
30 switch (m.id())
31 {
32 case Lemon::Shell::LemonShellAddWindow:
33 {
34 std::string title;
35 short state;
36 long id;
37 if(m.Decode(id, state, title)){
38 continue; // Invalid message
39 }
40
41 ShellWindow* win = new ShellWindow();
42
43 win->id = id;
44 win->state = state;
45 win->title = title;
46
47 windows.insert(std::pair<long, ShellWindow*>(id, win));
48
49 if(AddWindow) AddWindow(win);
50
51 if(win->state == Lemon::Shell::ShellWindowStateActive){
52 if(active && active != win){
53 active->state = Lemon::Shell::ShellWindowStateNormal;
54 }
55
56 active = win;
57 }
58 }
59 break;
60 case Lemon::Shell::LemonShellRemoveWindow: {
61 long id;
62 if(m.Decode(id)){
63 continue; // Invalid message
64 }
65
66 ShellWindow* win;
67 try{
68 win = windows.at(id);
69 } catch (const std::out_of_range& e){
70 printf("[Shell] Warning: LemonShellSetActive: Window ID out of range\n");
71 break;
72 }
73
74 if(RemoveWindow) RemoveWindow(win);
75
76 windows.erase(id);
77 break;
78 } case Lemon::Shell::LemonShellToggleMenu:

Callers

nothing calls this directly

Calls 7

idMethod · 0.80
DecodeMethod · 0.80
AddWindowFunction · 0.70
RemoveWindowFunction · 0.70
PollMethod · 0.45
insertMethod · 0.45
MinimizeMethod · 0.45

Tested by

no test coverage detected