2004-11-24 19:37:45 -08:00
|
|
|
#include "e.h"
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2005-05-12 21:05:43 -07:00
|
|
|
e_place_zone_region_smart_cleanup(E_Zone *zone)
|
|
|
|
{
|
|
|
|
E_Desk *desk;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
Eina_List *clients = NULL;
|
|
|
|
E_Client *ec;
|
2005-05-12 21:05:43 -07:00
|
|
|
|
|
|
|
E_OBJECT_CHECK(zone);
|
|
|
|
desk = e_desk_current_get(zone);
|
2015-03-13 12:45:07 -07:00
|
|
|
E_CLIENT_FOREACH(ec)
|
2005-05-12 21:05:43 -07:00
|
|
|
{
|
2013-01-11 02:34:29 -08:00
|
|
|
/* Build a list of windows on this desktop and not iconified. */
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
if ((ec->desk == desk) && (!ec->iconic) &&
|
|
|
|
(!ec->lock_user_location) && (!e_client_util_ignored_get(ec)))
|
2013-01-11 02:34:29 -08:00
|
|
|
{
|
|
|
|
int area;
|
|
|
|
Eina_List *ll;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
E_Client *ec2;
|
2013-01-11 02:34:29 -08:00
|
|
|
|
|
|
|
/* Ordering windows largest to smallest gives better results */
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
area = ec->w * ec->h;
|
|
|
|
EINA_LIST_FOREACH(clients, ll, ec2)
|
2013-01-11 02:34:29 -08:00
|
|
|
{
|
|
|
|
int testarea;
|
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
testarea = ec2->w * ec2->h;
|
|
|
|
/* Insert the ec if larger than the current ec */
|
2013-01-11 02:34:29 -08:00
|
|
|
if (area >= testarea)
|
|
|
|
{
|
2016-05-18 09:32:27 -07:00
|
|
|
clients = eina_list_prepend_relative_list(clients, ec, ll);
|
2013-01-11 02:34:29 -08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
/* Looped over all clients without placing, so place at end */
|
|
|
|
if (!ll) clients = eina_list_append(clients, ec);
|
2013-01-11 02:34:29 -08:00
|
|
|
}
|
2005-05-12 21:05:43 -07:00
|
|
|
}
|
|
|
|
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
/* Loop over the clients moving each one using the smart placement */
|
|
|
|
EINA_LIST_FREE(clients, ec)
|
2005-05-12 21:05:43 -07:00
|
|
|
{
|
2016-05-18 09:32:27 -07:00
|
|
|
int new_x = zone->x, new_y = zone->y;
|
|
|
|
Eina_List *l = eina_list_append(NULL, ec);
|
2005-05-12 21:05:43 -07:00
|
|
|
|
2016-05-18 09:32:27 -07:00
|
|
|
e_place_zone_region_smart(zone, l, zone->x, zone->y,
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
ec->w, ec->h, &new_x, &new_y);
|
2016-05-18 09:32:27 -07:00
|
|
|
eina_list_free(l);
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
evas_object_move(ec->frame, new_x, new_y);
|
2005-05-12 21:05:43 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-05-27 23:04:11 -07:00
|
|
|
static int
|
|
|
|
_e_place_cb_sort_cmp(const void *v1, const void *v2)
|
|
|
|
{
|
|
|
|
return (*((int *)v1)) - (*((int *)v2));
|
|
|
|
}
|
|
|
|
|
2016-04-21 11:48:49 -07:00
|
|
|
static Eina_Bool
|
2016-05-02 15:33:36 -07:00
|
|
|
ignore_client_and_break(const E_Client *ec)
|
2016-04-21 11:48:49 -07:00
|
|
|
{
|
|
|
|
if (ec->fullscreen) return EINA_TRUE;
|
|
|
|
if (ec->maximized)
|
|
|
|
{
|
2016-05-02 15:33:36 -07:00
|
|
|
E_Maximize max = ec->maximized & E_MAXIMIZE_DIRECTION;
|
2016-04-21 11:48:49 -07:00
|
|
|
|
|
|
|
if (max == E_MAXIMIZE_FULLSCREEN) return EINA_TRUE;
|
2016-05-02 15:33:36 -07:00
|
|
|
if (max == E_MAXIMIZE_BOTH) return EINA_TRUE;
|
2016-04-21 11:48:49 -07:00
|
|
|
}
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2016-05-02 15:33:36 -07:00
|
|
|
static Eina_Bool
|
|
|
|
ignore_client(const E_Client *ec, const Eina_List *skiplist)
|
|
|
|
{
|
|
|
|
if (eina_list_data_find(skiplist, ec)) return EINA_TRUE;
|
|
|
|
if (e_client_util_ignored_get(ec)) return EINA_TRUE;
|
|
|
|
if (!evas_object_visible_get(ec->frame)) return EINA_TRUE;
|
|
|
|
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
2006-04-20 04:30:25 -07:00
|
|
|
static int
|
2016-04-12 10:31:59 -07:00
|
|
|
_e_place_coverage_client_add(Eina_List *skiplist, int ar, int x, int y, int w, int h)
|
2006-04-20 04:30:25 -07:00
|
|
|
{
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
E_Client *ec;
|
2006-04-20 04:30:25 -07:00
|
|
|
int x2, y2, w2, h2;
|
|
|
|
int iw, ih;
|
2012-06-20 01:48:18 -07:00
|
|
|
int x0, x00, yy0, y00;
|
2007-10-30 19:41:52 -07:00
|
|
|
|
2016-05-02 15:33:36 -07:00
|
|
|
E_CLIENT_REVERSE_FOREACH(ec)
|
2006-04-20 04:30:25 -07:00
|
|
|
{
|
2016-04-21 11:48:49 -07:00
|
|
|
if (ignore_client(ec, skiplist)) continue;
|
2016-05-02 15:33:36 -07:00
|
|
|
if (ignore_client_and_break(ec)) break;
|
2016-04-12 10:31:59 -07:00
|
|
|
x2 = ec->x; y2 = ec->y; w2 = ec->w; h2 = ec->h;
|
|
|
|
if (E_INTERSECTS(x, y, w, h, x2, y2, w2, h2))
|
2013-01-11 02:34:29 -08:00
|
|
|
{
|
|
|
|
x0 = x;
|
|
|
|
if (x < x2) x0 = x2;
|
|
|
|
x00 = (x + w);
|
|
|
|
if ((x2 + w2) < (x + w)) x00 = (x2 + w2);
|
|
|
|
yy0 = y;
|
|
|
|
if (y < y2) yy0 = y2;
|
|
|
|
y00 = (y + h);
|
|
|
|
if ((y2 + h2) < (y + h)) y00 = (y2 + h2);
|
|
|
|
iw = x00 - x0;
|
|
|
|
ih = y00 - yy0;
|
|
|
|
ar += (iw * ih);
|
|
|
|
}
|
2006-04-20 04:30:25 -07:00
|
|
|
}
|
|
|
|
return ar;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2016-01-14 12:50:40 -08:00
|
|
|
_e_place_coverage_zone_obstacles_add_single(E_Zone_Obstacle *obs, int ar, int x, int y, int w, int h)
|
2006-04-20 04:30:25 -07:00
|
|
|
{
|
|
|
|
int x2, y2, w2, h2;
|
2016-01-14 12:50:40 -08:00
|
|
|
int x0, x00, yy0, y00;
|
|
|
|
int iw, ih;
|
2007-10-30 19:41:52 -07:00
|
|
|
|
2016-01-14 12:50:40 -08:00
|
|
|
x2 = obs->x; y2 = obs->y; w2 = obs->w; h2 = obs->h;
|
|
|
|
if (!E_INTERSECTS(x, y, w, h, x2, y2, w2, h2)) return ar;
|
|
|
|
|
|
|
|
/* FIXME: this option implies that windows should be resized when
|
|
|
|
* an autohide shelf toggles its visibility, but it is not used correctly
|
|
|
|
* and is instead used to determine whether shelves can be overlapped
|
|
|
|
*/
|
|
|
|
if (!e_config->border_fix_on_shelf_toggle) return 0x7fffffff;
|
|
|
|
|
|
|
|
x0 = x;
|
|
|
|
if (x < x2) x0 = x2;
|
|
|
|
x00 = (x + w);
|
|
|
|
if ((x2 + w2) < (x + w)) x00 = (x2 + w2);
|
|
|
|
yy0 = y;
|
|
|
|
if (y < y2) yy0 = y2;
|
|
|
|
y00 = (y + h);
|
|
|
|
if ((y2 + h2) < (y + h)) y00 = (y2 + h2);
|
|
|
|
iw = x00 - x0;
|
|
|
|
ih = y00 - yy0;
|
|
|
|
ar += (iw * ih);
|
|
|
|
return ar;
|
|
|
|
}
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2016-01-14 12:50:40 -08:00
|
|
|
static int
|
|
|
|
_e_place_coverage_zone_obstacles_add(E_Desk *desk, int ar, int x, int y, int w, int h)
|
|
|
|
{
|
|
|
|
E_Zone_Obstacle *obs;
|
|
|
|
|
|
|
|
EINA_INLIST_FOREACH(desk->obstacles, obs)
|
|
|
|
ar = _e_place_coverage_zone_obstacles_add_single(obs, ar, x, y, w, h);
|
|
|
|
EINA_INLIST_FOREACH(desk->zone->obstacles, obs)
|
|
|
|
ar = _e_place_coverage_zone_obstacles_add_single(obs, ar, x, y, w, h);
|
2006-04-20 04:30:25 -07:00
|
|
|
return ar;
|
|
|
|
}
|
|
|
|
|
2016-01-14 13:12:21 -08:00
|
|
|
static int *
|
|
|
|
_e_place_array_resize(int *array, int *pos, int *size)
|
|
|
|
{
|
|
|
|
(*pos)++;
|
|
|
|
if (*pos > *size)
|
|
|
|
{
|
|
|
|
*size += 32;
|
|
|
|
E_REALLOC(array, int, *size);
|
|
|
|
}
|
|
|
|
return array;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-04-12 10:31:59 -07:00
|
|
|
_e_place_desk_region_smart_obstacle_add(char *u_x, char *u_y, int **a_x, int **a_y, int *a_w, int *a_h, int *a_alloc_w, int *a_alloc_h, int zx, int zy, int zw, int zh, int bx, int by, int bw, int bh)
|
2016-01-14 13:12:21 -08:00
|
|
|
{
|
2016-04-12 10:31:59 -07:00
|
|
|
if (bx < zx)
|
2016-01-14 13:12:21 -08:00
|
|
|
{
|
|
|
|
bw += bx;
|
2016-04-12 10:31:59 -07:00
|
|
|
bx = zx;
|
2016-01-14 13:12:21 -08:00
|
|
|
}
|
2016-04-12 10:31:59 -07:00
|
|
|
if ((bx + bw) > zx + zw) bw = zx + zw - bx;
|
|
|
|
if (bx >= zx + zw) return;
|
|
|
|
if (by < zy)
|
2016-01-14 13:12:21 -08:00
|
|
|
{
|
|
|
|
bh += by;
|
2016-05-05 06:36:42 -07:00
|
|
|
by = zy;
|
2016-01-14 13:12:21 -08:00
|
|
|
}
|
2016-04-12 10:31:59 -07:00
|
|
|
if ((by + bh) > zy + zh) bh = zy + zh - by;
|
|
|
|
if (by >= zy + zh) return;
|
2016-01-14 13:12:21 -08:00
|
|
|
if (!u_x[bx])
|
|
|
|
{
|
|
|
|
*a_x = _e_place_array_resize(*a_x, a_w, a_alloc_w);
|
|
|
|
(*a_x)[*a_w - 1] = bx;
|
|
|
|
u_x[bx] = 1;
|
|
|
|
}
|
|
|
|
if (!u_x[bx + bw])
|
|
|
|
{
|
|
|
|
*a_x = _e_place_array_resize(*a_x, a_w, a_alloc_w);
|
|
|
|
(*a_x)[*a_w - 1] = bx + bw;
|
|
|
|
u_x[bx + bw] = 1;
|
|
|
|
}
|
|
|
|
if (!u_y[by])
|
|
|
|
{
|
|
|
|
*a_y = _e_place_array_resize(*a_y, a_h, a_alloc_h);
|
|
|
|
(*a_y)[*a_h - 1] = by;
|
|
|
|
u_y[by] = 1;
|
|
|
|
}
|
|
|
|
if (!u_y[by + bh])
|
|
|
|
{
|
|
|
|
*a_y = _e_place_array_resize(*a_y, a_h, a_alloc_h);
|
|
|
|
(*a_y)[*a_h - 1] = by + bh;
|
|
|
|
u_y[by + bh] = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2012-04-20 18:13:34 -07:00
|
|
|
e_place_desk_region_smart(E_Desk *desk, Eina_List *skiplist, int x, int y, int w, int h, int *rx, int *ry)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2013-01-11 02:34:29 -08:00
|
|
|
int a_w = 0, a_h = 0, a_alloc_w = 0, a_alloc_h = 0;
|
|
|
|
int *a_x = NULL, *a_y = NULL;
|
2016-04-12 10:31:59 -07:00
|
|
|
int zx, zy, zw, zh;
|
2013-01-11 02:34:29 -08:00
|
|
|
char *u_x = NULL, *u_y = NULL;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
E_Client *ec;
|
2004-11-24 19:37:45 -08:00
|
|
|
|
2005-05-27 22:03:27 -07:00
|
|
|
*rx = x;
|
|
|
|
*ry = y;
|
2007-09-19 17:17:39 -07:00
|
|
|
#if 0
|
|
|
|
/* DISABLE placement entirely for speed testing */
|
2005-05-27 22:03:27 -07:00
|
|
|
return 1;
|
|
|
|
#endif
|
2006-05-31 22:43:54 -07:00
|
|
|
|
|
|
|
if ((w <= 0) || (h <= 0))
|
|
|
|
{
|
2013-01-11 02:34:29 -08:00
|
|
|
printf("EEEK! trying to place 0x0 window!!!!\n");
|
|
|
|
return 1;
|
2006-05-31 22:43:54 -07:00
|
|
|
}
|
2007-10-30 19:41:52 -07:00
|
|
|
|
2005-05-27 22:03:27 -07:00
|
|
|
/* FIXME: this NEEDS optimizing */
|
2004-11-24 19:37:45 -08:00
|
|
|
a_w = 2;
|
|
|
|
a_h = 2;
|
|
|
|
a_x = E_NEW(int, 2);
|
|
|
|
a_y = E_NEW(int, 2);
|
2006-10-30 05:05:03 -08:00
|
|
|
a_alloc_w = 2;
|
|
|
|
a_alloc_h = 2;
|
2004-11-24 19:37:45 -08:00
|
|
|
|
2016-04-12 10:31:59 -07:00
|
|
|
zx = desk->zone->x;
|
|
|
|
zy = desk->zone->y;
|
2012-04-20 18:13:34 -07:00
|
|
|
zw = desk->zone->w;
|
|
|
|
zh = desk->zone->h;
|
2007-10-30 19:41:52 -07:00
|
|
|
|
2016-04-12 10:31:59 -07:00
|
|
|
u_x = calloc(zx + zw + 1, sizeof(char));
|
|
|
|
u_y = calloc(zy + zh + 1, sizeof(char));
|
2006-10-30 05:05:03 -08:00
|
|
|
|
2016-04-12 10:31:59 -07:00
|
|
|
a_x[0] = zx;
|
|
|
|
a_x[1] = zx + zw;
|
|
|
|
a_y[0] = zy;
|
|
|
|
a_y[1] = zy + zh;
|
2007-10-30 19:41:52 -07:00
|
|
|
|
2016-04-12 10:31:59 -07:00
|
|
|
u_x[zx] = 1;
|
|
|
|
u_x[zx + zw] = 1;
|
|
|
|
u_y[zy] = 1;
|
|
|
|
u_y[zy + zh] = 1;
|
2007-10-30 19:41:52 -07:00
|
|
|
|
2006-10-30 05:05:03 -08:00
|
|
|
if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART)
|
2006-04-20 04:30:25 -07:00
|
|
|
{
|
2016-01-14 13:16:57 -08:00
|
|
|
E_Zone_Obstacle *obs;
|
2013-01-11 02:34:29 -08:00
|
|
|
|
2016-01-14 13:16:57 -08:00
|
|
|
EINA_INLIST_FOREACH(desk->obstacles, obs)
|
2013-01-11 02:34:29 -08:00
|
|
|
{
|
|
|
|
int bx, by, bw, bh;
|
|
|
|
|
2016-04-12 10:31:59 -07:00
|
|
|
bx = obs->x;
|
|
|
|
by = obs->y;
|
2016-01-14 13:16:57 -08:00
|
|
|
bw = obs->w;
|
|
|
|
bh = obs->h;
|
2016-04-12 10:31:59 -07:00
|
|
|
if (E_INTERSECTS(bx, by, bw, bh, zx, zy, zw, zh))
|
2016-01-14 13:16:57 -08:00
|
|
|
_e_place_desk_region_smart_obstacle_add(u_x, u_y, &a_x, &a_y,
|
2016-04-12 10:31:59 -07:00
|
|
|
&a_w, &a_h, &a_alloc_w, &a_alloc_h, zx, zy, zw, zh, bx, by, bw, bh);
|
2016-01-14 13:16:57 -08:00
|
|
|
}
|
|
|
|
EINA_INLIST_FOREACH(desk->zone->obstacles, obs)
|
|
|
|
{
|
|
|
|
int bx, by, bw, bh;
|
2013-01-11 02:34:29 -08:00
|
|
|
|
2016-04-12 10:31:59 -07:00
|
|
|
bx = obs->x;
|
|
|
|
by = obs->y;
|
2016-01-14 13:16:57 -08:00
|
|
|
bw = obs->w;
|
|
|
|
bh = obs->h;
|
2016-04-12 10:31:59 -07:00
|
|
|
if (E_INTERSECTS(bx, by, bw, bh, zx, zy, zw, zh))
|
2016-01-14 13:12:21 -08:00
|
|
|
_e_place_desk_region_smart_obstacle_add(u_x, u_y, &a_x, &a_y,
|
2016-04-12 10:31:59 -07:00
|
|
|
&a_w, &a_h, &a_alloc_w, &a_alloc_h, zx, zy, zw, zh, bx, by, bw, bh);
|
2013-01-11 02:34:29 -08:00
|
|
|
}
|
2006-04-20 04:30:25 -07:00
|
|
|
}
|
2007-10-30 19:41:52 -07:00
|
|
|
|
2016-05-02 15:33:36 -07:00
|
|
|
E_CLIENT_REVERSE_FOREACH(ec)
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2013-01-11 02:34:29 -08:00
|
|
|
int bx, by, bw, bh;
|
|
|
|
|
2016-04-21 11:48:49 -07:00
|
|
|
if (ignore_client(ec, skiplist)) continue;
|
2016-05-02 15:33:36 -07:00
|
|
|
if (ignore_client_and_break(ec)) break;
|
2012-06-20 23:19:43 -07:00
|
|
|
|
2016-04-12 10:31:59 -07:00
|
|
|
bx = ec->x;
|
|
|
|
by = ec->y;
|
compositor rewrite / charlie-foxtrot situation
huge fustercluck commit because there wasn't really a way to separate out the changes. better to just rip it all out at once.
* compositor and window management completely rewritten. this was the goal for E19, but it pretty much required everything existing to be scrapped since it wasn't optimized, streamlined, or sensible. now instead of having the compositor strapped to the window manager like an outboard motor, it's housed more like an automobile engine.
** various comp structs have been merged into other places (eg. E_Comp_Zone is now just part of E_Zone where applicable), leading to a large deduplication of attributes
** awful E_Comp_Win is totally dead, having been replaced with e_comp_object smart objects which work just like normal canvas objects
** protocol-specific window management and compositor functionality is now kept exclusively in backend files
** e_pixmap api provides generic client finding and rendering api
** screen/xinerama screens are now provided directly by compositor on startup and re-set on change
** e_comp_render_update finally replaced with eina_tiler
** wayland compositor no longer creates X windows
** compositor e_layout removed entirely
* e_container is gone. this was made unnecessary in E18, but I kept it to avoid having too much code churn in one release. its sole purpose was to catch some events and handle window stacking, both of which are now just done by the compositor infra
* e_manager is just for screensaver and keybind stuff now, possibly remove later?
* e_border is gone along with a lot of its api. e_client has replaced it, and e_client has been rewritten completely; some parts may be similar, but the design now relies upon having a functional compositor
** window configuration/focus functions are all removed. all windows are now managed solely with evas_object_X functions on the "frame" member of a client, just as any other canvas object can be managed.
*** do NOT set interceptors on a client's comp_object. seriously.
* startup order rewritten: compositor now starts much earlier, other things just use attrs and members of the compositor
* ecore_x_pointer_xy_get usage replaced with ecore_evas_pointer_xy_get
* e_popup is totally gone, existing usage replaced by e_comp_object_util_add where applicable, otherwise just placed normally on the canvas
* deskmirror is (more) broken for now
* illume is totally fucked
* Ecore_X_Window replaced with Ecore_Window in most cases
* edge binding XWindows replaced with regular canvas objects
* some E_Win functionality has changed such that delete callbacks are now correctly called in ALL cases. various dialogs have been updated to not crash as a result
comp files and descriptions:
e_comp.c - overall compositor functions, rendering/update loop, shape cutting
e_comp_x.c - X window management and compositor functionality
e_comp_wl.c - Wayland surface management and compositor functionality
e_comp_canvas.c - general compositor canvas functions and utilities
e_comp_object.c - E_Client->frame member for managing clients as Evas_Objects, utility functions for adding objects to the compositor rendering systems
additional authors: ivan.briano@intel.com
feature: new compositor
removal: e_border, e_container, e_popup
2014-01-14 17:19:12 -08:00
|
|
|
bw = ec->w;
|
|
|
|
bh = ec->h;
|
2013-01-11 02:34:29 -08:00
|
|
|
|
2016-04-12 10:31:59 -07:00
|
|
|
if (E_INTERSECTS(bx, by, bw, bh, zx, zy, zw, zh))
|
2016-01-14 13:12:21 -08:00
|
|
|
_e_place_desk_region_smart_obstacle_add(u_x, u_y, &a_x, &a_y,
|
2016-04-12 10:31:59 -07:00
|
|
|
&a_w, &a_h, &a_alloc_w, &a_alloc_h, zx, zy, zw, zh, bx, by, bw, bh);
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
2005-05-27 23:04:11 -07:00
|
|
|
qsort(a_x, a_w, sizeof(int), _e_place_cb_sort_cmp);
|
|
|
|
qsort(a_y, a_h, sizeof(int), _e_place_cb_sort_cmp);
|
|
|
|
free(u_x);
|
|
|
|
free(u_y);
|
2005-05-13 06:34:21 -07:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
{
|
2013-01-11 02:34:29 -08:00
|
|
|
int i, j;
|
|
|
|
int area = 0x7fffffff;
|
2004-11-24 19:37:45 -08:00
|
|
|
|
2016-04-12 10:31:59 -07:00
|
|
|
if ((x <= zx + (zw - w)) &&
|
|
|
|
(y <= zy + (zh - h)))
|
2015-12-31 09:57:47 -08:00
|
|
|
{
|
|
|
|
int ar = 0;
|
|
|
|
|
2016-04-12 10:31:59 -07:00
|
|
|
ar = _e_place_coverage_client_add(skiplist, ar,
|
2015-12-31 09:57:47 -08:00
|
|
|
x, y,
|
|
|
|
w, h);
|
2016-04-12 10:31:59 -07:00
|
|
|
|
2015-12-31 09:57:47 -08:00
|
|
|
if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART)
|
2016-01-14 12:50:40 -08:00
|
|
|
ar = _e_place_coverage_zone_obstacles_add(desk, ar,
|
2015-12-31 09:57:47 -08:00
|
|
|
x, y,
|
|
|
|
w, h);
|
2016-04-12 10:31:59 -07:00
|
|
|
|
2015-12-31 09:57:47 -08:00
|
|
|
if (ar < area)
|
|
|
|
{
|
|
|
|
area = ar;
|
|
|
|
*rx = x;
|
|
|
|
*ry = y;
|
|
|
|
if (ar == 0) goto done;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
for (j = 0; j < a_h - 1; j++)
|
2013-01-11 02:34:29 -08:00
|
|
|
{
|
|
|
|
for (i = 0; i < a_w - 1; i++)
|
|
|
|
{
|
2016-04-12 10:31:59 -07:00
|
|
|
if ((a_x[i] <= zx + (zw - w)) &&
|
|
|
|
(a_y[j] <= zy + (zh - h)))
|
2013-01-11 02:34:29 -08:00
|
|
|
{
|
|
|
|
int ar = 0;
|
|
|
|
|
2016-04-12 10:31:59 -07:00
|
|
|
ar = _e_place_coverage_client_add(skiplist, ar,
|
2013-01-11 02:34:29 -08:00
|
|
|
a_x[i], a_y[j],
|
|
|
|
w, h);
|
2016-04-12 10:31:59 -07:00
|
|
|
|
2013-01-11 02:34:29 -08:00
|
|
|
if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART)
|
2016-01-14 12:50:40 -08:00
|
|
|
ar = _e_place_coverage_zone_obstacles_add(desk, ar,
|
2013-01-11 02:34:29 -08:00
|
|
|
a_x[i], a_y[j],
|
|
|
|
w, h);
|
2016-04-12 10:31:59 -07:00
|
|
|
|
2013-01-11 02:34:29 -08:00
|
|
|
if (ar < area)
|
|
|
|
{
|
|
|
|
area = ar;
|
|
|
|
*rx = a_x[i];
|
|
|
|
*ry = a_y[j];
|
|
|
|
if (ar == 0) goto done;
|
|
|
|
}
|
|
|
|
}
|
2016-04-12 10:31:59 -07:00
|
|
|
if ((a_x[i + 1] - w > zx) && (a_y[j] <= zy + (zh - h)))
|
2013-01-11 02:34:29 -08:00
|
|
|
{
|
|
|
|
int ar = 0;
|
|
|
|
|
2016-04-12 10:31:59 -07:00
|
|
|
ar = _e_place_coverage_client_add(skiplist, ar,
|
2013-01-11 02:34:29 -08:00
|
|
|
a_x[i + 1] - w, a_y[j],
|
|
|
|
w, h);
|
2016-04-12 10:31:59 -07:00
|
|
|
|
2013-01-11 02:34:29 -08:00
|
|
|
if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART)
|
2016-01-14 12:50:40 -08:00
|
|
|
ar = _e_place_coverage_zone_obstacles_add(desk, ar,
|
2013-01-11 02:34:29 -08:00
|
|
|
a_x[i + 1] - w, a_y[j],
|
|
|
|
w, h);
|
2016-04-12 10:31:59 -07:00
|
|
|
|
2013-01-11 02:34:29 -08:00
|
|
|
if (ar < area)
|
|
|
|
{
|
|
|
|
area = ar;
|
|
|
|
*rx = a_x[i + 1] - w;
|
|
|
|
*ry = a_y[j];
|
|
|
|
if (ar == 0) goto done;
|
|
|
|
}
|
|
|
|
}
|
2016-04-12 10:31:59 -07:00
|
|
|
if ((a_x[i + 1] - w > zx) && (a_y[j + 1] - h > zy))
|
2013-01-11 02:34:29 -08:00
|
|
|
{
|
|
|
|
int ar = 0;
|
|
|
|
|
2016-04-12 10:31:59 -07:00
|
|
|
ar = _e_place_coverage_client_add(skiplist, ar,
|
2013-01-11 02:34:29 -08:00
|
|
|
a_x[i + 1] - w, a_y[j + 1] - h,
|
|
|
|
w, h);
|
2016-04-12 10:31:59 -07:00
|
|
|
|
2013-01-11 02:34:29 -08:00
|
|
|
if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART)
|
2016-01-14 12:50:40 -08:00
|
|
|
ar = _e_place_coverage_zone_obstacles_add(desk, ar,
|
2013-01-11 02:34:29 -08:00
|
|
|
a_x[i + 1] - w, a_y[j + 1] - h,
|
|
|
|
w, h);
|
2016-04-12 10:31:59 -07:00
|
|
|
|
2013-01-11 02:34:29 -08:00
|
|
|
if (ar < area)
|
|
|
|
{
|
|
|
|
area = ar;
|
|
|
|
*rx = a_x[i + 1] - w;
|
|
|
|
*ry = a_y[j + 1] - h;
|
|
|
|
if (ar == 0) goto done;
|
|
|
|
}
|
|
|
|
}
|
2016-04-12 10:31:59 -07:00
|
|
|
if ((a_x[i] <= zx + (zw - w)) && (a_y[j + 1] - h > zy))
|
2013-01-11 02:34:29 -08:00
|
|
|
{
|
|
|
|
int ar = 0;
|
|
|
|
|
2016-04-12 10:31:59 -07:00
|
|
|
ar = _e_place_coverage_client_add(skiplist, ar,
|
2013-01-11 02:34:29 -08:00
|
|
|
a_x[i], a_y[j + 1] - h,
|
|
|
|
w, h);
|
2016-04-12 10:31:59 -07:00
|
|
|
|
2013-01-11 02:34:29 -08:00
|
|
|
if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART)
|
2016-01-14 12:50:40 -08:00
|
|
|
ar = _e_place_coverage_zone_obstacles_add(desk, ar,
|
2013-01-11 02:34:29 -08:00
|
|
|
a_x[i], a_y[j + 1] - h,
|
|
|
|
w, h);
|
2016-04-12 10:31:59 -07:00
|
|
|
|
2013-01-11 02:34:29 -08:00
|
|
|
if (ar < area)
|
|
|
|
{
|
|
|
|
area = ar;
|
|
|
|
*rx = a_x[i];
|
|
|
|
*ry = a_y[j + 1] - h;
|
|
|
|
if (ar == 0) goto done;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2004-11-24 19:37:45 -08:00
|
|
|
}
|
2013-01-11 02:34:29 -08:00
|
|
|
done:
|
2004-11-24 19:37:45 -08:00
|
|
|
E_FREE(a_x);
|
|
|
|
E_FREE(a_y);
|
2007-09-19 17:17:39 -07:00
|
|
|
|
2016-04-12 10:31:59 -07:00
|
|
|
if ((*rx + w) > desk->zone->x + desk->zone->w) *rx = desk->zone->x + desk->zone->w - w;
|
|
|
|
if (*rx < zx) *rx = zx;
|
|
|
|
if ((*ry + h) > desk->zone->y + desk->zone->h) *ry = desk->zone->y + desk->zone->h - h;
|
|
|
|
if (*ry < zy) *ry = zy;
|
2007-09-19 17:17:39 -07:00
|
|
|
|
2008-01-10 23:33:57 -08:00
|
|
|
// printf("0 - PLACE %i %i | %ix%i\n", *rx, *ry, w, h);
|
2007-10-30 19:41:52 -07:00
|
|
|
|
2004-11-24 19:37:45 -08:00
|
|
|
return 1;
|
|
|
|
}
|
2005-09-12 22:19:25 -07:00
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2012-04-20 18:13:34 -07:00
|
|
|
e_place_zone_region_smart(E_Zone *zone, Eina_List *skiplist, int x, int y, int w, int h, int *rx, int *ry)
|
|
|
|
{
|
|
|
|
return e_place_desk_region_smart(e_desk_current_get(zone), skiplist,
|
|
|
|
x, y, w, h, rx, ry);
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2015-03-18 15:09:09 -07:00
|
|
|
e_place_zone_cursor(E_Zone *zone, int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, int it, int *rx, int *ry)
|
2005-09-12 22:19:25 -07:00
|
|
|
{
|
|
|
|
int cursor_x = 0, cursor_y = 0;
|
2005-09-19 22:14:57 -07:00
|
|
|
int zone_right, zone_bottom;
|
2016-05-12 09:10:48 -07:00
|
|
|
int zx, zy, zw, zh;
|
2005-09-12 22:19:25 -07:00
|
|
|
|
2006-06-08 12:05:41 -07:00
|
|
|
E_OBJECT_CHECK_RETURN(zone, 0);
|
2005-09-12 22:19:25 -07:00
|
|
|
|
2015-03-13 14:44:24 -07:00
|
|
|
ecore_evas_pointer_xy_get(e_comp->ee, &cursor_x, &cursor_y);
|
2005-09-29 05:48:32 -07:00
|
|
|
*rx = cursor_x - (w >> 1);
|
|
|
|
*ry = cursor_y - (it >> 1);
|
2005-09-19 22:14:57 -07:00
|
|
|
|
2016-05-12 09:10:48 -07:00
|
|
|
e_zone_useful_geometry_get(zone, &zx, &zy, &zw, &zh);
|
|
|
|
|
2007-10-30 19:41:52 -07:00
|
|
|
if (*rx < zone->x)
|
2016-05-12 09:10:48 -07:00
|
|
|
*rx = zx;
|
2005-09-19 22:14:57 -07:00
|
|
|
|
2007-10-30 19:41:52 -07:00
|
|
|
if (*ry < zone->y)
|
2016-05-12 09:10:48 -07:00
|
|
|
*ry = zy;
|
2005-09-19 22:14:57 -07:00
|
|
|
|
2016-05-12 09:10:48 -07:00
|
|
|
zone_right = zx + zw;
|
|
|
|
zone_bottom = zy + zh;
|
2005-09-19 22:14:57 -07:00
|
|
|
|
2007-10-30 19:41:52 -07:00
|
|
|
if ((*rx + w) > zone_right)
|
2005-09-19 22:14:57 -07:00
|
|
|
*rx = zone_right - w;
|
|
|
|
|
2007-10-30 19:41:52 -07:00
|
|
|
if ((*ry + h) > zone_bottom)
|
2005-09-19 22:14:57 -07:00
|
|
|
*ry = zone_bottom - h;
|
|
|
|
|
2005-09-12 22:19:25 -07:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2005-09-26 03:30:38 -07:00
|
|
|
e_place_zone_manual(E_Zone *zone, int w, int h, int *rx, int *ry)
|
2005-09-22 10:10:02 -07:00
|
|
|
{
|
|
|
|
int cursor_x = 0, cursor_y = 0;
|
2005-09-12 22:19:25 -07:00
|
|
|
|
2005-09-22 10:10:02 -07:00
|
|
|
E_OBJECT_CHECK_RETURN(zone, 0);
|
2005-09-12 22:19:25 -07:00
|
|
|
|
2015-03-13 14:44:24 -07:00
|
|
|
ecore_evas_pointer_xy_get(e_comp->ee, &cursor_x, &cursor_y);
|
2005-09-29 05:48:32 -07:00
|
|
|
if (rx) *rx = cursor_x - (w >> 1);
|
|
|
|
if (ry) *ry = cursor_y - (h >> 1);
|
2005-09-22 10:10:02 -07:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
2013-01-11 02:34:29 -08:00
|
|
|
|