Changeset 3942
- Timestamp:
- 11/18/09 16:31:49 (4 years ago)
- Location:
- neercs/trunk/src
- Files:
-
- 10 edited
-
client.c (modified) (4 diffs)
-
configuration.c (modified) (1 diff)
-
grab.c (modified) (6 diffs)
-
input.c (modified) (2 diffs)
-
main.c (modified) (11 diffs)
-
mytrace.c (modified) (4 diffs)
-
screens.c (modified) (3 diffs)
-
screensaver.c (modified) (1 diff)
-
server.c (modified) (3 diffs)
-
wm.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
neercs/trunk/src/client.c
r3940 r3942 38 38 #define NEERCS_RECV_BUFSIZE 128*1024 39 39 40 void mainloop(struct screen_list *screen_list) 40 void mainloop(struct screen_list *screen_list) 41 41 { 42 42 char * buf = NULL; … … 44 44 long long unsigned int last_key_time = 0; 45 45 last_key_time = get_us(); 46 46 47 47 for(;;) 48 48 { … … 142 142 } 143 143 } 144 144 145 145 if(ret) 146 146 break; 147 147 148 148 ret = caca_get_event(screen_list->dp, 149 149 CACA_EVENT_KEY_PRESS … … 153 153 if(ret) 154 154 ret = send_event(ev, screen_list); 155 155 156 156 if(ret) 157 157 break; 158 } 159 158 } 159 160 160 end: 161 161 if(buf) 162 162 free(buf); 163 163 164 164 } -
neercs/trunk/src/configuration.c
r3939 r3942 301 301 if (IS_VALUE("true") || IS_VALUE("1")) screen_list->mini = 1; 302 302 else screen_list->mini = 0; 303 303 304 304 } else if(IS_TOKEN("status_bar")) 305 305 { -
neercs/trunk/src/grab.c
r3899 r3942 62 62 return -1; 63 63 } 64 64 65 65 child = mytrace_fork(parent); 66 66 67 67 snprintf(fdstr, sizeof(fdstr), "/proc/%ld/fd", pid); 68 68 fddir = opendir(fdstr); … … 83 83 84 84 snprintf(fdstr, sizeof(fdstr), "/proc/%ld/fd/%s", pid, fddirent->d_name); 85 85 86 86 if(stat(fdstr, &stat_buf) < 0) 87 87 continue; … … 109 109 } 110 110 closedir(fddir); 111 111 112 112 if(i>=(int)sizeof(to_open)-1) 113 113 { … … 173 173 continue; 174 174 } 175 175 176 176 /* FIXME Only needed once */ 177 177 mytrace_sctty(child, fd); … … 316 316 refresh = 0; 317 317 } 318 318 319 319 if(!caca_get_event(screen_list->dp, 320 320 CACA_EVENT_KEY_PRESS … … 323 323 &ev, 10000)) 324 324 continue; 325 325 326 326 t = caca_get_event_type(&ev); 327 327 328 328 if(t & CACA_EVENT_KEY_PRESS) 329 329 { -
neercs/trunk/src/input.c
r3914 r3942 111 111 screen_list->last_switch = get_us(); 112 112 screen_list->cube.in_switch = 1; 113 screen_list->cube.side = 0; 113 screen_list->cube.side = 0; 114 114 } 115 115 refresh = 1; … … 122 122 screen_list->last_switch = get_us(); 123 123 screen_list->cube.in_switch = 1; 124 screen_list->cube.side = 1; 124 screen_list->cube.side = 1; 125 125 } 126 126 refresh = 1; -
neercs/trunk/src/main.c
r3940 r3942 83 83 84 84 int mainret = -1; 85 85 86 86 screen_list = create_screen_list(); 87 87 screen_list->default_shell = getenv("SHELL"); … … 152 152 153 153 mainloop(screen_list); 154 154 155 155 /* Clean up */ 156 156 mainret = 0; … … 175 175 if(screen_list->cv) 176 176 caca_free_canvas(screen_list->cv); 177 177 178 178 for(i = 0; i < screen_list->count; i++) 179 179 { … … 183 183 if(screen_list->socket_path[SOCK_SERVER]) 184 184 free(screen_list->socket_path[SOCK_SERVER]); 185 185 186 186 if(screen_list->socket_path[SOCK_CLIENT]) 187 187 { … … 189 189 free(screen_list->socket_path[SOCK_CLIENT]); 190 190 } 191 191 192 192 if(screen_list->socket[SOCK_CLIENT]) 193 193 close(screen_list->socket[SOCK_CLIENT]); 194 194 195 195 if(screen_list->socket[SOCK_SERVER]) 196 196 close(screen_list->socket[SOCK_SERVER]); … … 200 200 201 201 option = screen_list->config; 202 202 203 203 while(option) 204 204 { … … 209 209 free(kromeugnon); 210 210 } 211 211 212 212 for(i=0; i<screen_list->recurrent_list->count; i++) 213 213 { … … 220 220 if(screen_list->recurrent_list) 221 221 free(screen_list->recurrent_list); 222 222 223 223 if(screen_list->session_name) 224 224 free(screen_list->session_name); … … 226 226 if(screen_list->title) 227 227 free(screen_list->title); 228 228 229 229 free(screen_list); 230 230 } … … 270 270 screen_list->locked = 0; 271 271 screen_list->lock_offset = 0; 272 screen_list->lock_on_detach = 0; 272 screen_list->lock_on_detach = 0; 273 273 screen_list->attached = 1; 274 274 screen_list->socket[SOCK_SERVER] = 0; … … 286 286 screen_list->attach = 0; 287 287 screen_list->forceattach = 0; 288 288 289 289 screen_list->force_refresh = 0; 290 290 screen_list->cube.in_switch = 0; -
neercs/trunk/src/mytrace.c
r3891 r3942 419 419 size_t size = sizeof(struct termios); 420 420 int ret, err; 421 421 422 422 if(ptrace(PTRACE_GETREGS, t->pid, NULL, ®s) < 0) 423 423 { … … 425 425 return -1; 426 426 } 427 427 428 428 /* Backup the data that we will use */ 429 429 if(memcpy_from_target(t, backup_data, regs.RSP, size) < 0) 430 430 return -1; 431 431 432 432 ret = remote_syscall(t, MYCALL_IOCTL, fd,TCGETS, regs.RSP); 433 433 err = errno; 434 434 435 435 memcpy_from_target(t, (char *)tos, regs.RSP, size); 436 436 437 437 /* Restore the data */ 438 438 memcpy_into_target(t, regs.RSP, backup_data, size); 439 439 440 440 errno = err; 441 441 return ret; … … 453 453 size_t size = sizeof(struct termios); 454 454 int ret, err; 455 455 456 456 if(ptrace(PTRACE_GETREGS, t->pid, NULL, ®s) < 0) 457 457 { … … 463 463 if(memcpy_from_target(t, backup_data, regs.RSP, size) < 0) 464 464 return -1; 465 465 466 466 memcpy_into_target(t, regs.RSP, (char *)tos, size); 467 467 468 468 ret = remote_syscall(t, MYCALL_IOCTL, fd, TCSETS, regs.RSP); 469 469 err = errno; 470 470 471 471 /* Restore the data */ 472 472 memcpy_into_target(t, regs.RSP, backup_data, size); 473 473 474 474 errno = err; 475 475 return ret; -
neercs/trunk/src/screens.c
r3914 r3942 187 187 screen_list->height = caca_get_canvas_height(screen_list->cv) - (screen_list->mini*6) - screen_list->status; 188 188 189 if(!screen_list->dont_update_coords) 189 if(!screen_list->dont_update_coords) 190 190 { 191 191 update_windows_props(screen_list); … … 200 200 201 201 wm_refresh(screen_list); 202 202 203 203 caca_gotoxy(screen_list->cv, 204 204 screen_list->screen[screen_list->pty]->x + … … 206 206 screen_list->screen[screen_list->pty]->y + 207 207 caca_get_cursor_y(screen_list->screen[screen_list->pty]->cv)); 208 209 208 209 210 210 if(screen_list->mini) 211 211 { -
neercs/trunk/src/screensaver.c
r3551 r3942 125 125 caca_import_memory(flying_toaster->toaster[i], 126 126 toaster_text[i], 127 strlen(toaster_text[i]), "utf8"); 127 strlen(toaster_text[i]), "utf8"); 128 128 caca_import_memory(flying_toaster->mask[i], 129 129 toaster_mask[i], 130 strlen(toaster_mask[i]), "utf8"); 130 strlen(toaster_mask[i]), "utf8"); 131 131 } 132 132 -
neercs/trunk/src/server.c
r3914 r3942 161 161 debug("Can't refresh (%s), with %d bytes (out of %d)", strerror(errno), towrite > bufsize ? bufsize : towrite, towrite); 162 162 return -1; 163 } 163 } 164 164 written += n; 165 165 towrite -= n; … … 261 261 /* Read program output */ 262 262 refresh |= update_screens_contents(screen_list); 263 263 264 264 /* Check if we got something from the client */ 265 265 while (screen_list->socket[SOCK_SERVER] && (n = read(screen_list->socket[SOCK_SERVER], buf, sizeof(buf)-1)) > 0) … … 432 432 else 433 433 debug("Skipping refresh (%lld < %d)", tdiff, screen_list->delay); 434 } 435 436 } 437 438 if(screen_list->force_refresh) 434 } 435 436 } 437 438 if(screen_list->force_refresh) 439 439 { 440 440 wm_refresh(screen_list); 441 request_refresh(screen_list); 442 } 443 441 request_refresh(screen_list); 442 } 443 444 444 eof = 1; 445 445 for(i=0; i < screen_list->count; i++) -
neercs/trunk/src/wm.c
r3939 r3942 1 /* 1 /* 2 2 * neercs console-based window manager 3 3 * Copyright (c) 2006 Sam Hocevar <sam@zoy.org> … … 39 39 s->h = h; 40 40 41 /* 41 /* 42 42 * caca_set_canvas_boundaries() is bugged as hell, so let's resize it by 43 43 * hands
Note: See TracChangeset
for help on using the changeset viewer.
