and... working on virtual desktops.. moved desktop view to be a normal


			
			
				devs/princeamd/enlightenment-0.17-elive
			
			
		
Carsten Haitzler 21 years ago
parent aec66cb567
commit ce769c8f21
  1. 38
      src/actions.c
  2. 14
      src/border.c
  3. 6
      src/border.h
  4. 120
      src/desktops.c
  5. 11
      src/desktops.h
  6. 2
      src/e_ferite.fec
  7. 2
      src/fs.c
  8. 4
      src/main.c
  9. 2
      src/view.c

@ -546,6 +546,7 @@ e_act_move_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.fixed) return;
if (move_mode >= E_GUIDES_BOX)
b->hold_changes = 1; /* if non opaque */
b->mode.move = 1;
@ -584,6 +585,7 @@ e_act_move_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.fixed) return;
b->hold_changes = 0; /* if non opaque */
b->current.requested.x = b->current.x;
b->current.requested.y = b->current.y;
@ -615,6 +617,7 @@ e_act_move_go (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.fixed) return;
b->current.requested.x += dx;
b->current.requested.y += dy;
if (dx != 0) b->current.requested.dx = dx;
@ -659,6 +662,8 @@ e_act_resize_start (void *o, E_Action *a, void *data, int x, int y, int rx, int
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.min.w == b->client.max.w) return;
if (b->client.min.h == b->client.max.h) return;
if (b->current.shaded != 0) return;
if (resize_mode >= E_GUIDES_BOX)
b->hold_changes = 1; /* if non opaque */
@ -731,6 +736,8 @@ e_act_resize_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.min.w == b->client.max.w) return;
if (b->client.min.h == b->client.max.h) return;
if (b->current.shaded != 0) return;
b->hold_changes = 0; /* if non opaque */
b->current.requested.x = b->current.x;
@ -760,6 +767,8 @@ e_act_resize_go (void *o, E_Action *a, void *data, int x, int y, int rx, int
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.min.w == b->client.max.w) return;
if (b->client.min.h == b->client.max.h) return;
if (b->current.shaded != 0) return;
if (b->mode.resize == 1)
{
@ -825,6 +834,7 @@ e_act_resize_h_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.min.w == b->client.max.w) return;
if (b->current.shaded != 0) return;
if (resize_mode >= E_GUIDES_BOX)
b->hold_changes = 1; /* if non opaque */
@ -876,6 +886,7 @@ e_act_resize_h_stop (void *o, E_Action *a, void *data, int x, int y, int rx, in
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.min.w == b->client.max.w) return;
if (b->current.shaded != 0) return;
b->hold_changes = 0; /* if non opaque */
b->current.requested.x = b->current.x;
@ -905,6 +916,7 @@ e_act_resize_h_go (void *o, E_Action *a, void *data, int x, int y, int rx, in
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.min.w == b->client.max.w) return;
if (b->current.shaded != 0) return;
if (b->mode.resize == 5)
{
@ -956,6 +968,7 @@ e_act_resize_v_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.min.h == b->client.max.h) return;
if (b->current.shaded != 0) return;
if (resize_mode >= E_GUIDES_BOX)
b->hold_changes = 1; /* if non opaque */
@ -1009,6 +1022,7 @@ e_act_resize_v_stop (void *o, E_Action *a, void *data, int x, int y, int rx, in
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.min.h == b->client.max.h) return;
if (b->current.shaded != 0) return;
b->hold_changes = 0; /* if non opaque */
b->current.requested.x = b->current.x;
@ -1038,6 +1052,7 @@ e_act_resize_v_go (void *o, E_Action *a, void *data, int x, int y, int rx, in
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.min.h == b->client.max.h) return;
if (b->current.shaded != 0) return;
if (b->mode.resize == 7)
{
@ -1077,6 +1092,7 @@ e_act_close_start (void *o, E_Action *a, void *data, int x, int y, int rx, int r
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.is_desktop) return;
if (b->win.client) e_icccm_delete(b->win.client);
return;
UN(a);
@ -1096,6 +1112,7 @@ e_act_kill_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.is_desktop) return;
if (b->win.client) e_window_kill_client(b->win.client);
return;
UN(a);
@ -1119,6 +1136,7 @@ e_act_cb_shade(int val, void *data)
b = data;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.is_desktop) return;
if (val == 0)
{
OBJ_REF(b);
@ -1159,6 +1177,7 @@ e_act_cb_unshade(int val, void *data)
b = data;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.is_desktop) return;
if (val == 0)
{
OBJ_REF(b);
@ -1195,6 +1214,7 @@ e_act_shade_start (void *o, E_Action *a, void *data, int x, int y, int rx, int r
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.is_desktop) return;
if (b->current.shaded == 0) e_act_cb_shade(0, b);
else e_act_cb_unshade(0, b);
return;
@ -1215,6 +1235,7 @@ e_act_raise_start (void *o, E_Action *a, void *data, int x, int y, int rx, int r
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.is_desktop) return;
e_border_raise(b);
return;
UN(a);
@ -1234,6 +1255,7 @@ e_act_lower_start (void *o, E_Action *a, void *data, int x, int y, int rx, int r
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.is_desktop) return;
e_border_lower(b);
return;
UN(a);
@ -1253,6 +1275,7 @@ e_act_raise_lower_start (void *o, E_Action *a, void *data, int x, int y, int rx,
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.is_desktop) return;
return;
UN(a);
UN(data);
@ -1291,6 +1314,7 @@ e_act_menu_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.is_desktop) return;
return;
UN(a);
UN(data);
@ -1304,9 +1328,6 @@ e_act_menu_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
static void
e_act_exit_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
exit(0);
return;
UN(a);
@ -1321,9 +1342,6 @@ e_act_exit_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
static void
e_act_restart_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
e_exec_restart();
return;
UN(a);
@ -1343,6 +1361,7 @@ e_act_stick_start (void *o, E_Action *a, void *data, int x, int y, int rx, int r
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.is_desktop) return;
if (b->client.sticky) b->client.sticky = 0;
else b->client.sticky = 1;
b->changed = 1;
@ -1359,9 +1378,6 @@ e_act_stick_start (void *o, E_Action *a, void *data, int x, int y, int rx, int r
static void
e_act_sound_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
return;
UN(a);
UN(data);
@ -1380,6 +1396,7 @@ e_act_iconify_start (void *o, E_Action *a, void *data, int x, int y, int rx, int
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.is_desktop) return;
return;
UN(a);
UN(data);
@ -1398,6 +1415,7 @@ e_act_max_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->client.is_desktop) return;
if (b->current.shaded > 0) return;
if ((b->mode.move) || (b->mode.resize)) return;
b->mode.move = 0;
@ -1486,7 +1504,7 @@ e_act_desk_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
int desk = 0;
if (a->params) desk = atoi(a->params);
e_desktops_goto(desk);
e_desktops_goto_desk(desk);
return;
UN(o);
UN(a);

@ -62,8 +62,9 @@ static void e_cb_border_visibility(E_Border *b);
static void e_border_poll(int val, void *data);
/* what to dowhen we're idle */
static void
e_idle(void *data)
void
e_border_update_borders(void)
{
Evas_List l;
@ -88,6 +89,12 @@ e_idle(void *data)
}
}
e_db_flush();
}
static void
e_idle(void *data)
{
e_border_update_borders();
return;
UN(data);
}
@ -2371,6 +2378,9 @@ e_border_viewable(E_Border *b)
if (b->current.y >= b->desk->real.h)
return 0;
if (!b->current.visible)
return 0;
return 1;
}

@ -87,12 +87,17 @@ struct _E_Border
int titlebar;
int border;
int handles;
int is_desktop;
int w, h;
struct {
int requested;
int x, y;
int gravity;
} pos;
int desk;
struct {
int x, y;
} area;
} client;
struct {
@ -121,6 +126,7 @@ struct _E_Border
};
void e_border_update_borders(void);
void e_border_apply_border(E_Border *b);
void e_border_reshape(E_Border *b);
E_Border *e_border_adopt(Window win, int use_client_pos);

@ -11,7 +11,6 @@ static Evas_List desktops = NULL;
static Window e_base_win = 0;
static int screen_w, screen_h;
static int current_desk = 0;
static int current_desk_x = 0;
static void e_idle(void *data);
@ -108,7 +107,6 @@ e_desktops_scroll(E_Desktop *desk, int dx, int dy)
e_window_gravity_set(b->win.main, grav);
}
grav_stick = StaticGravity;
e_window_gravity_set(desk->win.desk, grav_stick);
/* scroll */
e_window_move_resize(desk->win.container,
xd, yd,
@ -127,7 +125,6 @@ e_desktops_scroll(E_Desktop *desk, int dx, int dy)
/* e_window_gravity_set(b->win.main, grav_stick);*/
}
e_window_move_resize(desk->win.container, 0, 0, screen_w, screen_h);
e_window_gravity_reset(desk->win.desk);
for (l = desk->windows; l; l = l->next)
{
E_Border *b;
@ -175,31 +172,42 @@ e_desktops_free(E_Desktop *desk)
void
e_desktops_init_file_display(E_Desktop *desk)
{
desk->view = e_view_new();
desk->view->size.w = desk->real.w;
desk->view->size.h = desk->real.h;
desk->view->is_desktop = 1;
E_View *v;
E_Border *b;
v = e_view_new();
v->size.w = desk->real.w;
v->size.h = desk->real.h;
v->options.back_pixmap = 1;
v->is_desktop = 1;
/* fixme: later */
/* uncomment this and comment out the next line for some tress testing */
/* e_strdup(v->dir, "/dev"); */
e_strdup(v->dir, e_file_home());
/* FIXME: load bg here */
{
char buf[4096];
sprintf(buf, "%s/default.bg.db", e_config_get("backgrounds"));
desk->view->bg = e_background_load(buf);
char buf[4096];
sprintf(buf, "%s/default.bg.db", e_config_get("backgrounds"));
v->bg = e_background_load(buf);
}
e_view_realize(v);
/* fixme: later */
/* uncomment this and comment out the next line for some tress testing */
/* e_strdup(desk->view->dir, "/dev"); */
e_strdup(desk->view->dir, e_file_home());
e_view_realize(desk->view);
e_window_hint_set_borderless(v->win.base);
e_window_hint_set_sticky(v->win.base, 1);
e_window_hint_set_layer(v->win.base, 1);
e_window_set_title(v->win.base, "Desktop");
e_window_set_name_class(v->win.base, "FileView", "Desktop");
e_window_set_min_size(v->win.base, desk->real.w, desk->real.h);
e_window_set_max_size(v->win.base, desk->real.w, desk->real.h);
b = e_border_adopt(v->win.base, 1);
b->client.sticky = 1;
b->client.fixed = 1;
b->client.is_desktop = 1;
if (desk->view->options.back_pixmap)
e_view_update(desk->view);
desk->win.desk = desk->view->win.base;
e_window_reparent(desk->win.desk, desk->win.container, 0, 0);
e_window_show(desk->win.desk);
if (v->options.back_pixmap) e_view_update(v);
}
E_Desktop *
@ -227,8 +235,6 @@ e_desktops_new(void)
desktops = evas_list_append(desktops, desk);
e_desktops_init_file_display(desk);
return desk;
}
@ -237,6 +243,9 @@ e_desktops_add_border(E_Desktop *d, E_Border *b)
{
if ((!d) || (!b)) return;
b->desk = d;
b->client.desk = d->desk.desk;
b->client.area.x = d->desk.area.x;
b->client.area.y = d->desk.area.y;
e_border_raise(b);
}
@ -263,18 +272,13 @@ e_desktops_show(E_Desktop *d)
void
e_desktops_hide(E_Desktop *d)
{
if (d->view->options.back_pixmap) e_view_update(d->view);
e_window_hide(d->win.main);
}
int
e_desktops_get_num(void)
{
Evas_List l;
int i;
for (i = 0, l = desktops; l; l = l->next, i++);
return i;
return 8;
}
E_Desktop *
@ -297,16 +301,62 @@ e_desktops_get_current(void)
}
void
e_desktops_goto(int d)
e_desktops_goto_desk(int d)
{
e_desktops_goto(d, 0, 0);
}
void
e_desktops_goto(int d, int ax, int ay)
{
int dx;
E_Desktop *desk;
dx = d - current_desk_x;
desk = e_desktops_get(0);
if (desk)
{
e_desktops_scroll(desk, -(dx * desk->real.w), 0);
int dx, dy;
Evas_List l;
if ((d == desk->desk.desk) &&
(ax == desk->desk.area.x) &&
(ay == desk->desk.area.y)) return;
dx = ax - desk->desk.area.x;
dy = ay - desk->desk.area.y;
for (l = desk->windows; l; l = l->next)
{
E_Border *b;
b = l->data;
if (!b->client.sticky)
{
if (b->client.desk != d)
{
if (b->current.requested.visible)
{
b->current.requested.visible = 0;
b->changed = 1;
}
}
else
{
if (!b->current.requested.visible)
{
b->current.requested.visible = 1;
b->changed = 1;
}
}
}
}
e_border_update_borders();
/* if no scrolling... */
e_desktops_scroll(desk, -(dx * desk->real.w), -(dy * desk->real.h));
/* if scrolling.. need to setup a timeout etc. */
desk->desk.desk = d;
desk->desk.area.x = ax;
desk->desk.area.y = ay;
}
current_desk_x = d;
}

@ -19,14 +19,18 @@ struct _E_Desktop
struct {
Window main;
Window container;
Window desk;
} win;
E_View *view;
int x, y;
struct {
int w, h;
} real, virt;
Evas_List windows;
struct {
int desk;
struct {
int x, y;
} area;
} desk;
int changed;
};
@ -43,6 +47,7 @@ void e_desktops_hide(E_Desktop *d);
int e_desktops_get_num(void);
E_Desktop *e_desktops_get(int d);
int e_desktops_get_current(void);
void e_desktops_goto(int d);
void e_desktops_goto_desk(int d);
void e_desktops_goto(int d, int ax, int ay);
#endif

@ -43,7 +43,7 @@ namespace e {
function flip_to_desktop( number desk )
%{
e_desktops_goto( (long)desk );
e_desktops_goto_desk( (long)desk );
%}
function get_current_desktop()

@ -20,7 +20,7 @@ e_fs_flush_timeout(int val, void *data)
{
if (efsd_flush(ec) > 0)
e_add_event_timer("e_fs_flush_timeout()",
0.01, e_fs_flush_timeout, 0, NULL);
0.00, e_fs_flush_timeout, 0, NULL);
}
UN(data);
UN(val);

@ -131,7 +131,9 @@ main(int argc, char **argv)
#ifdef USE_FERITE
e_ferite_init();
#endif
e_desktops_init_file_display(e_desktops_get(0));
setup();
e_event_loop();

@ -1201,7 +1201,7 @@ e_view_queue_icon_xy_record(E_View *v)
char name[4096];
sprintf(name, "icon_xy_record.%s", v->dir);
e_add_event_timer(name, 2.00, e_view_write_icon_xy_timeout, 0, v);
e_add_event_timer(name, 0.10, e_view_write_icon_xy_timeout, 0, v);
}

Loading…
Cancel
Save