Commit Graph

118 Commits

Author SHA1 Message Date
Jean-Philippe Andre 8a21384759 win: Move main menu back to win.edc (fix sizing)
As Andy reported, the main menu geometry is not correct after
my recent changes, as the application contents slide underneath
the menu bar. In fact the menu bar is just floating above
everything else.

So I've tried to move the menu to the framespace (as it should
belong to the frame), but the sizing algos for both the window
and the menu make some assumptions that render this task quite
difficult. Eventually I would like to be able to swallow the
menu somewhere else inside the border... but not right now.
2016-11-28 15:52:09 +09:00
Jean-Philippe Andre 51ba193bda win: Remove unused variable 2016-11-28 13:51:44 +09:00
Jean-Philippe Andre f1418dbb20 win: Avoid calling need_frame_adjust all the time
This function was meant to be called only before
finalize. This avoids getenv and string compares.
2016-11-28 10:57:15 +09:00
Carsten Haitzler 892f4abe37 efl ui win - stop trying to get data of non-image icons
x11 updates trying to update x properties from image data when icon is
not an image is causing lots of error spam. fix this to check type
first before getting data.
2016-11-27 22:50:03 +09:00
Jean Guyomarc'h 2a75a47b19 efl_ui_win: fix build with no support for X 2016-11-24 20:24:19 +01:00
Jean-Philippe Andre 61c8d7f46e win: Disable CSD shadow if alpha and borderless
If the content has alpha, we can't ensure that the square shadow
will look good. So, hide it.
2016-11-24 17:49:17 +09:00
Jean-Philippe Andre 246023d1b3 win: Fix (hack around) E internal windows in Wayland
My previous patches have broken E Wayland internal windows, as
the compositor wants to create Server-Side Decorations[1] but
based on some mysterious heuristics, E will decide to show or
not SSD. It seems the surface geometry, window geometry,
input region and maybe opaque region need to all match. There
was a pixel difference in the theme which broke everything,
also CSD shadows must be turned off in that case.

This also fixes inputs as for some reason a mismatching input
region vs window geometry would break pointer move/up/down in
those internal windows.

[1] I believe this is not a great idea and E should never draw
    any server-side decorations in Wayland. Wayland was supposed
    to mean only CSD, no more SSD.
2016-11-24 17:05:27 +09:00
Jean-Philippe Andre aaaf77965a win: Add quick hack to restore mouse inputs in E Wayland
E Wayland internal windows are a special beast. Somehow all their
events are intercepted by a special input_obj... but never get
propagated back to the elm_win.

Major side-effect: you get 2 window decorations. I believe there is
some dark magic inside E that tries to figure out when to show
a decoration and this conflicts with CSD.

But hey, it's late so I want to "fix" this and figure out the details
later.
2016-11-23 23:53:50 +09:00
Jean-Philippe Andre 72694331b4 win: Fix event forwarder ad//del
On event listener del we were adding one more forward
callback. Copy & pasta error, obviously.
2016-11-23 23:48:53 +09:00
Jean-Philippe Andre ea7bbfe47d win: Factorize code for move_resize
Oops, I probably went a bit overboard with this ~_~
2016-11-23 23:48:53 +09:00
Jean-Philippe Andre 4da634c26f elm: Mark icon as non-atspi
This fixes elm_suite
2016-11-23 14:02:01 +09:00
Jean-Philippe Andre 10e2b4417c win: Simplify elm_win_util_dialog_add
This now uses a similar code path as standard windows. Shouldn't
there be an EO class for dialogs, too?
2016-11-23 13:04:13 +09:00
Jean-Philippe Andre 0fc049a321 win: Move modal blocker to border group
Legacy themes are still supported with a fallback code.
2016-11-23 13:04:13 +09:00
Jean-Philippe Andre 60308d7421 win: Code simplification 2016-11-23 13:04:13 +09:00
Jean-Philippe Andre 29e7d477b1 win: Simplify modal legacy API and add test case
This fixes the modality of windows shown after setting
the flag.
2016-11-23 13:04:13 +09:00
Jean-Philippe Andre 0de72b44c1 win: Fix support for legacy themes (elm_bg)
For standard windows, we want to create an elm_bg object if
the theme is a legacy one. Otherwise the default theme
doesn't require an extra object, just a rectangle.
2016-11-23 13:04:13 +09:00
Jean-Philippe Andre 8c505e3191 win: Remove menu from EDC group (fixes compatibility)
This fixes compatibility with legacy themes (ie. every single
theme in existence beyond the default one, for now), by checking
where to swallow the menu widget. If a legacy theme is used,
the legacy swallow should be used, and it will all look correct.

Moving forward I hope to get rid of the internal edje object
entirely, except for compatibility reasons.
2016-11-23 13:04:13 +09:00
Jean-Philippe Andre fc4c07e735 win: Add frame to inline and socket windows
This simplifies the cases by adding a border edje on all
windows except fake (damn fake windows). Shadows and borders
are always disabled on such windows (but we could easily change
that in the future).
2016-11-23 13:04:13 +09:00
Jean-Philippe Andre 5f6673f623 win: Implement unresizable mode (fixed size windows)
This sends a signal to the CSD frame to hide the bottom
bar and disable the resize borders.
2016-11-23 13:04:13 +09:00
Jean-Philippe Andre c31a70a4f5 win: Add content_set API for window main content
The idea is to not have resize object in a stack anymore,
but a couple of swallows in the frame and if the stack of
resize objects is wanted, then the user can still explicitely
create it.
2016-11-23 13:04:13 +09:00
Jean-Philippe Andre 234bc18f02 win: Always add a frame object
All windows, except for fake, inline & socket images,
should have a frame object to handle all the new APIs and
slots (background, content, indicator, etc...).

The theme will need to handle various modes:
 - full CSD
 - solid CSD without shadows
 - server-side decoration (borderless without shadows)
 - borderless with shadows

This means that the default theme must be used for windows,
so that the required edc parts exist. Apart from the standard
background, it is very unlikely that a theme will have changed
anything in win.edc, conformant.edc or border.edc.

This might prove a controversial move, but the alternative would
be to have increasingly complex code handling new themes with
a single edje object and older themes by swallowing tons of
components magically.

Eventually, the win edje object should also not be used anymore.

By default, windows should not have CSD enabled, except on Wayland.
This patch does not handle frame_obj with server-side decorations
yet.
2016-11-23 13:04:12 +09:00
Jean-Philippe Andre 0e52264ae0 win: Add background part to the win border
Use Efl.Part for window to manipulate the background.

Two part names are used in EDC:
 - elm.rect.background
 - elm.swallow.background

For apps the part name is only "background".

To set a solid color background (alpha is ok):
 efl_gfx_color_set(efl_part(win, "background"), r, g, b, a);

To set an image:
 efl_file_set(efl_part(win, "background"), "image.jpg", NULL);

To set an object:
 efl_content_set(efl_part(win, "background"), subobj);

The solid bg is invisible by default, will become visible and use
COPY render mode if a color is set. Standard window uses the
swallow part.

@feature
2016-11-23 13:04:12 +09:00
Jean-Philippe Andre cb172de3da win: Move main menu to the border edje group
The main menu can now be contained inside the CSD border
rather than inside the win edje group.
2016-11-23 13:04:12 +09:00
Jean-Philippe Andre b2dbf9d9dd win: Fix maximized geometry with CSD in X
There is still a geometry issue after un-maximizing.
2016-11-23 13:04:12 +09:00
Jean-Philippe Andre 2147d5cb33 win: Handle move & resize with CSD on X
This is for client-side decorations on Xorg.

Mouse-based move and resize of the window now work fine, but
there are still a few glitches:

1- GL resize is awful (nothing much we can do)

2- Move/resize requests trigger a focus out event,
   this in turn changes the style of the window from focussed to
   unfocussed. This is thus different from what we see in Wayland
   (no focus state change at all) and in usual X11 (focus changes,
   but the frame keeps its focussed style).

   To counteract this effect, we prevent the frame from changing
   style on focus,out if we know we are moving or resizing. But
   we don't know that if the compositor moves/resizes (eg. with
   Alt key); The focus event happens too early, before the move
   or resize events. At least in E.
2016-11-23 13:04:12 +09:00
Jean-Philippe Andre 2b50d56bba win: Set proper cursor for resize borders (CSD in X)
They look horrible in E (X), why is the cursor theme not applied?
2016-11-23 13:04:12 +09:00
Jean-Philippe Andre 4722b685cf ecore_evas/x: Inform WM about borders and shadows
This exploits the existing X Atom "GTK_FRAME_EXTENTS"
2016-11-23 13:04:12 +09:00
Jean-Philippe Andre 63fcd3d831 win: Make X windows border when using CSD mode 2016-11-23 13:04:12 +09:00
Jean-Philippe Andre c91360fcbd win: Apply alpha for CSD mode, even in X 2016-11-23 13:04:12 +09:00
Jean-Philippe Andre 79b0737b6c win: Factorize code to select frame mode
This also adds an env var for debug to force the frame on or off.
2016-11-23 13:04:12 +09:00
Ji-Youn Park bfea8c8fca efl_ui_win: add function client can start moving or resizing the window.
The result of this API can only guarantee that the request has been forwared to the server,
    In fact, there is no guarantee that the request can be processed by the server.

    In order to use this API correctly, avoid the following conditions.
    (The following situations will return a failure)

    1. Calling a function in the absence of a touch(mouse) down event.
    2. Calling the function twice more than once before the touch(mouse) up event.
    3. Calling the function when the elm win already resizing or moving the window.
    4. Calling the function using a combination of unsupported modes.

    Right usage
    1. touch(mouse) down event
    2. efl_ui_win_move_resize_start only once using the supported mode combination.
    3. touch(mouse) up event

    If a touch(mouse) up event occurs after calling the function, it automatically ends the window move and resize operation.

    Since there are some non-exclusive modes, you can use a combination of modes.(ELM_WIN_MOVE_RESIZE_MOVE is exclusive with others)
    However, Some combination of mode is limited for technical reasons.
    At present, only the following nine combinations are allowed.
    For more information, see the Elm.Win.Move_Resize_Mode.

    1. EFL_UI_WIN_MOVE_RESIZE_MOVE
    2. EFL_UI_WIN_MOVE_RESIZE_TOP
    3. EFL_UI_WIN_MOVE_RESIZE_BOTTOM
    4. EFL_UI_WIN_MOVE_RESIZE_LEFT
    5. EFL_UI_WIN_MOVE_RESIZE_RIGHT
    6. EFL_UI_WIN_MOVE_RESIZE_TOP | EFL_UI_WIN_MOVE_RESIZE_LEFT
    7. EFL_UI_WIN_MOVE_RESIZE_TOP | EFL_UI_WIN_MOVE_RESIZE_RIGHT
    8. EFL_UI_WIN_MOVE_RESIZE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_LEFT
    9. EFL_UI_WIN_MOVE_RESIZE_BOTTOM | EFL_UI_WIN_MOVE_RESIZE_RIGHT
2016-11-21 20:21:15 +08:30
Daniel Zaoui 7d127c1d07 Win: fix modal feature during window closing
During window deletion, decreasing modality depends on
the window visibility.
Because the visibility was set to false before treating the
modality, it was never decreased, leading to never have still
existing windows being reachable.
Now, we check window visibility before it is modified.

@fix
2016-11-17 08:00:23 +02:00
Jean-Philippe Andre f50b0fed13 elm/evas: Fix disappearance of window icons with CSD
After a few patches trying to fix clipping of frame or
non-frame objects the icon finally ended up invisible. Even
if the elm_icon was marked as is_frame, its internal evas
object image would not have the flag set, thus it would be
clipped out.

Solution: Propagate the is_frame flag to all smart children,
not only when setting it but also when adding new members.
A hack with the API indicates that the frame edje is a very
special object that does not propagate the flag.

See also:
7ce79be1a1
0f6c33eff1
9c9c8809a7
ac5ca9281c
2016-11-16 20:48:58 +09:00
Shinwoo Kim e648f1e85e [elementary][atspi] change accessible description to char* from const char*
Summary:
The accessible name is char*, this could confuse API user.
If we provide user callback to get description, an user would return allocated string.
The usage of elm_interface_atspi_description_get/set should be same with elm_interface_atspi_name_get/set

Reviewers: lukasz.stanislawski, cedric, raster

Reviewed By: raster

Subscribers: stanluk, jpeg

Differential Revision: https://phab.enlightenment.org/D4378
2016-11-10 11:11:48 +09:00
Chris Michael 4343432ee7 elementary: Use software engine for wayland client pointers
There seem to be an issue with the ecore_evas_wayland_egl engine when
using them for cursors. The issue is that a black square shows up
behind the mouse pointer. This does not happen with the wayland_shm
engine so use wayland_shm engine for mouse pointers (for now) until
this can be sorted out.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-01 10:55:10 -04:00
Carsten Haitzler 30d7410699 elm win - add ifdef around wl code so it compiles with wl off 2016-10-29 10:16:29 +09:00
Chris Michael 3749ea47f9 elementary: Remove debug printing
NB: No functional changes, just removing left over prints

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-28 14:28:04 -04:00
Chris Michael e179115f41 elementary: Add internal function to set wayland cursor
Add an internal elm function we can call from withint els_cursor.c so
that we can set window cursor/pointer images based on what is supplied
by els_cursor.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-28 14:04:05 -04:00
Chris Michael 53f406a0a3 elementary: Fix build break for non-wayland builds
This fixes an issue where build would be broken if not building with
Wayland support.

Fixes T4778

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-28 12:35:12 -04:00
Chris Michael ecc3e2fa51 elementary: Don't set "move" cursor on wayland client apps
As most (if not all) compositors will draw their own "move" cursor
when moving windows around, there's no real need to set this one
client side.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-28 09:55:27 -04:00
Chris Michael e77efe72f7 elementary: Fix issue of extra pointer being displayed
As we only want to show our custom EFL cursors when the mouse is
actually inside the window, use the _elm_win_mouse_in/out functions to
control pointer visibility.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-28 09:55:27 -04:00
Chris Michael 257b4f0af8 elementary: Don't create pointer canvas for inlined_image
As we don't need a pointer or pointer canvas for
ELM_WIN_INLINED_IMAGE, add missing type check and skip creating
pointer canvas there.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-28 09:55:27 -04:00
Chris Michael 44746f24e9 elementary: Use separate checks for pointer object vs pointer canvas
As under the drm engine a softcursor will be created, but not a
pointer canvas, we need to use separate if checks in certain places
like showing, hiding the mouse pointer/canvas.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-28 09:55:27 -04:00
Chris Michael efe5150bb8 elementary: Delete mouse pointer when window is closed
If we are running Wayland clients which create their own mouse
pointers, then we need to remove the mouse pointer ecore_evas when the
window is deleted else we get crashes because the mouse pointer is
still trying to render. This fixes the issue of internal Enlightenment
windows causing crashes when closed.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-26 09:33:24 -04:00
Cedric Bail da22a046aa elementary: fix build without wayland. 2016-10-25 15:02:46 -07:00
Chris Michael c173be4db7 elementary: Implement support for EFL Wayland mouse pointers
This patch implements support for EFL Wayland applications to be able
to use EFL mouse pointers instead of ugly X cursors inside a Wayland
compositor. This does Not use Softcursor so the mouse pointer becomes
it's own surface which is then sent to wl_pointer.

NB: Some small hiccups when using wayland_shm such as dropped frames.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-25 14:22:07 -04:00
Chris Michael 0b290a260c Revert "elementary: Provide EFL mouse pointers for Wayland Client applications"
This reverts commit 0a46096337.

Reverting these changes as we need to handle mouse pointer differently.
2016-10-25 11:07:32 -04:00
Chris Michael 13f77a2456 Revert "elementary: Don't try to set pointer edj if there is no pointer"
This reverts commit 3686a8aa89.

Reverting this as we need to handle mouse pointers a different way.
2016-10-25 11:07:32 -04:00
Chris Michael ce827f3481 Revert "elementary: Don't always show pointer object"
This reverts commit f56dc8d0c3.

Reverting these as we need to handle mouse pointers a different way.
2016-10-25 11:07:32 -04:00
Chris Michael f56dc8d0c3 elementary: Don't always show pointer object
If we are using softcursor mode during intercept show, then we should
check that the pointer is actually in the canvas before showing it
else we end up with mouse pointers drawn on the canvas even when the
mouse itself is nowhere near a window.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-24 13:08:00 -04:00