Re: [RFC PATCH 06/12] tablet-shell: Applications can run on tablet
On Fri, 10 Aug 2012 13:23:34 +0800 Juan Zhao juan.j.z...@linux.intel.com wrote: Thanks for your reply. Still don't understand why not implement wl_shell on tablet_shell to customize it for a embeded system. Sorry, I don't think I can explain it any better, but I'll try. wl_shell interfaces were defined in compositor side, in wayland/src/wayland.xml. Most client applications used them. Yes, because so far we have been targetting only the desktop. There once were plans to move wl_shell out of the core protocol file, but it didn't happen. I still do not consider wl_shell as part of the core Wayland. It is just a too important extension on the desktop to be moved out now, and that is also why it fell under the protocol freeze and stability requirement with 0.95. Desktop shell implement one for desktop enviroment. And it works cool.I like it. For embeded environment, implement a special one according to its usage. And allow the client applications works cool here too. Why should we force the applications for tablet-shell to be special, and not to use that general wl_shell interfaces? And raise a bar for them? For example, calculator, memo, or even webkit. Do you mean, there is some problems with this direction? Yes, I tried to explain that with the help of the Gimp. Have you ever tried any application that is using more than one top-level-like window? Or even apps with dialogs on tablet_shell? BTW, GIMP is a window with several sub-windows. So we send a event to tell the client: please set fullscreen to avoid such conditions. I think you have only seen the new(?) Gimp GUI. The traditional one looks like this (the WM is fluxbox): http://people.collabora.com/~pq/gimp-gui.png (1.6MB) How would you manage the windows of such an application on a tablet, given that the application is using the wl_shell interface? If you implement wl_shell in the tablet-shell environment and it works fine, then what do you need the tablet_shell protocol for? Desktop-only apps won't use it anyway. You ended up creating another desktop window manager, not a new shell. The point of tablet_shell, as it is in the Weston repository, is to be a new *shell*, not another desktop window manager. If apps did use tablet_shell protocol, then your point is moot: the application is already explicitly modified to use tablet_shell. Also, the same reasoning applies, if apps need to change their way of using wl_shell, when they run on tablets. It introduces tablet-specific code into the application, except it will be messier. My postulate is, apps using wl_shell cannot work fine on a tablet environment. The GUI will be somewhat unnatural the least, if not misbehaving. I am starting to believe, that you want to write another desktop window manager. The problem with that is that you are trying to do it in tablet_shell, which is another shell, not just a window manager. Would it not make more sense (conceptually) for you to fork desktop-shell instead? You are still free to replace the private desktop_shell protocol with whatever, as long as you keep the public wl_shell. Hmm, or what about this: you use the desktop-shell plugin, and let it handle wl_shell protocol, but replace only the desktop-shell client? The configuration of desktop-shell plugin could say which special client to launch. Then you could write a tablet-shell client replacing the desktop-shell client, and get a tablet-looking *desktop*. It would still be the same desktop window management, but with a different GUI. How'd that sound? Thanks, pq Thanks, Juan On Thu, 2012-08-09 at 10:07 +0300, Pekka Paalanen wrote: On Thu, 09 Aug 2012 03:04:53 +0800 Juan Zhao juan.j.z...@linux.intel.com wrote: On Wed, 2012-08-08 at 12:18 +0300, Pekka Paalanen wrote: The applications, i.e. the normal clients, are yet another thing. What I meant was that the two different protocol extensions were not separated properly in tablet shell. In the desktop shell, the public protocol extension is wl_shell, and the private protocol extension is desktop_shell. When a client initialises, the set of advertised global interfaces will contain either wl_shell or tablet_generic, or at least the client should bind to only one of the two. If it binds to tablet_generic, if knows it has to be full-screen always, it doesn't need an event to tell it that. How does it know what size to make its surface, I don't know. Looking at outputs or add a configure event? Do you mean the client itself should know it was working for tablet-shell and need some modification? Yes, exactly. As the very first thing, it needs to know to expect the global interface tablet_shell instead of wl_shell. If the server indeed advertises only tablet_shell, and not wl_shell, the application cannot use any of the window management or other features offered
Re: [PATCH weston] shell: Don't draw shadows for maximized windows.
On Thu, 9 Aug 2012 12:44:43 -0400 Kristian Høgsberg hoegsb...@gmail.com wrote: On Wed, Aug 08, 2012 at 02:43:21PM +0300, Pekka Paalanen wrote: Krh, was the the idea of first sending all new surface attributes, and then committing those at once on wl_surface::attach rejected, or was this part of the protocol just not fixed yet? Or is there some other clever mechanism to make this atomic? It wasn't rejected, just never implemented. The problem is that in practice it's not necessary, since typically the protocol buffer will ensure atomicity. Even if that gets flushed unexpectedly, most clients will re-render in response to frame events or input events, which we send out at the beginning of the frame, giving clients a (just under) 16ms window to get things done before their requests might get broken across two frames. Errm... But yes, the fact that it is possible isn't really compatible with every frame is perfect. Mostly I've just been afraid of overengineering this, but maybe we can just specify that certain requests are latched until the next surface.attach request. As a rule of thumb this would apply to all requests that alter state that depends on the buffer size or contents. This would apply to opaque and input regions, and in fact, wl_shell_surface.set_fullscreen already works this way. It's also pretty easy for extensions to tie into this. They just document which properties are latched. For example position of overlaid surfaces or buffer contents rotation could be done that way. By the way, the way it works now, we invalidate the input region if we attach a buffer of a different size, but I'm thinking that that's very un-wayland-ish and we should just always expect the client to attach a new input region. Yes! :-) I've actually pondered, if we should implement a Weston synchronous debug mode, where after handling every single protocol request it would force a repaint (not damage) and make sure the repaint hits the screen. Maybe even add a delay to let possible glitches stay longer on screen. Considering we don't run thousands of requests per second with a few clients, it shouldn't be unbearably slow, just slow. Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] shell: show input panel on configure, if activated
--- src/shell.c | 29 + 1 Datei geändert, 17 Zeilen hinzugefügt(+), 12 Zeilen entfernt(-) diff --git a/src/shell.c b/src/shell.c index 9c8a8a9..670cfd6 100644 --- a/src/shell.c +++ b/src/shell.c @@ -2520,13 +2520,22 @@ unlock(struct wl_listener *listener, void *data) } static void +show_input_panel(struct desktop_shell *shell, struct weston_surface *surface) +{ + wl_list_insert(shell-input_panel_layer.surface_list, + surface-layer_link); + weston_surface_assign_output(surface); + weston_surface_damage(surface); + weston_slide_run(surface, surface-geometry.height, 0, NULL, NULL); +} + +static void show_input_panels(struct wl_listener *listener, void *data) { struct desktop_shell *shell = container_of(listener, struct desktop_shell, show_input_panel_listener); struct input_panel_surface *surface, *next; - struct weston_surface *ws; shell-showing_input_panels = true; @@ -2534,14 +2543,8 @@ show_input_panels(struct wl_listener *listener, void *data) shell-input_panel_layer.link); wl_list_for_each_safe(surface, next, - shell-input_panel.surfaces, link) { - ws = surface-surface; - wl_list_insert(shell-input_panel_layer.surface_list, - ws-layer_link); - weston_surface_assign_output(ws); - weston_surface_damage(ws); - weston_slide_run(ws, ws-geometry.height, 0, NULL, NULL); - } + shell-input_panel.surfaces, link) + show_input_panel(shell, surface-surface); } static void @@ -2905,17 +2908,19 @@ static void input_panel_configure(struct weston_surface *surface, int32_t sx, int32_t sy) { struct weston_mode *mode = surface-output-current; + struct desktop_shell *shell = surface-private; + GLfloat x = (mode-width - surface-buffer-width) / 2; GLfloat y = mode-height - surface-buffer-height; - /* Don't map the input panel here, wait for -* show_input_panels signal. */ - weston_surface_configure(surface, surface-output-x + x, surface-output-y + y, surface-buffer-width, surface-buffer-height); + + if (!surface-layer_link.next || wl_list_empty(surface-layer_link)) + show_input_panel(shell, surface); } static void -- 1.7.11.4 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH v2] shell: show input panel on configure, if activated
--- src/shell.c | 30 ++ 1 Datei geändert, 18 Zeilen hinzugefügt(+), 12 Zeilen entfernt(-) diff --git a/src/shell.c b/src/shell.c index 9c8a8a9..5d4fb41 100644 --- a/src/shell.c +++ b/src/shell.c @@ -2520,13 +2520,22 @@ unlock(struct wl_listener *listener, void *data) } static void +show_input_panel(struct desktop_shell *shell, struct weston_surface *surface) +{ + wl_list_insert(shell-input_panel_layer.surface_list, + surface-layer_link); + weston_surface_assign_output(surface); + weston_surface_damage(surface); + weston_slide_run(surface, surface-geometry.height, 0, NULL, NULL); +} + +static void show_input_panels(struct wl_listener *listener, void *data) { struct desktop_shell *shell = container_of(listener, struct desktop_shell, show_input_panel_listener); struct input_panel_surface *surface, *next; - struct weston_surface *ws; shell-showing_input_panels = true; @@ -2534,14 +2543,8 @@ show_input_panels(struct wl_listener *listener, void *data) shell-input_panel_layer.link); wl_list_for_each_safe(surface, next, - shell-input_panel.surfaces, link) { - ws = surface-surface; - wl_list_insert(shell-input_panel_layer.surface_list, - ws-layer_link); - weston_surface_assign_output(ws); - weston_surface_damage(ws); - weston_slide_run(ws, ws-geometry.height, 0, NULL, NULL); - } + shell-input_panel.surfaces, link) + show_input_panel(shell, surface-surface); } static void @@ -2905,17 +2908,20 @@ static void input_panel_configure(struct weston_surface *surface, int32_t sx, int32_t sy) { struct weston_mode *mode = surface-output-current; + struct desktop_shell *shell = surface-private; + GLfloat x = (mode-width - surface-buffer-width) / 2; GLfloat y = mode-height - surface-buffer-height; - /* Don't map the input panel here, wait for -* show_input_panels signal. */ - weston_surface_configure(surface, surface-output-x + x, surface-output-y + y, surface-buffer-width, surface-buffer-height); + + if (shell-showing_input_panels + (!surface-layer_link.next || wl_list_empty(surface-layer_link))) + show_input_panel(shell, surface); } static void -- 1.7.11.4 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Weston xwm as a client
Hi. We were wondering about splitting the XWM from Weston into its own process. This email discusses that. We have Xwayland as one process and weston + xwm as another on the current architecture. Xwayland is a Wayland client and it's the X server. xwm is a module of the Wayland server and a X client [0]. Quite often xwayland triggers a Wayland event that blocks while xwm is already blocked waiting a X request from xwayland [1]. There's too much potential for deadlock when we're working with two different protocol streams tied up with two different processes. Other cons of the current architecture is that we need a server-side small toolkit for window decoration and things like cursor settings. Now, I see two possible solutions when breaking in xwayland, weston and xwm, where the last being a separate process: #1 solution: XWM maps the windows. - little tricky, since the xwm need to access the wl_surfaces of the xwayland client. - we'd need a way to share wl_surface objects among clients. - would avoid weston_shell_interface, since the xwm will now access it as a regular client. #2 solution: compositor maps the windows. - replicate inside the compositor all the windows position, surface and related information. - WM wayland protocol sends a configure window (wid, x, y, w, h) to the compositor, triggered at ConfigureNotify. Xwayland sends a set_window_id when realize_window is done with the surface created. Compositor combine both information acquired and maps the window on the screen (stack it properly, activate, etc). - we'd still need weston_shell_interface These both solutions should solve the deadlock problem we're facing. Decoration drawing can be made now on client side, and cursor settings and all toolkit integration looks easier now. Also, IMHO just the fact of separate the Window Manager implies an architecture more modularized where it naturally fits better with the X one. Both solutions still create a shell_surface, which is great cause we can rotate, switch windows, etc. The first solution requires more thoughts and more understanding but looks more pretty a bit. The second solution still requires some internal interfaces on Weston just for Xwayland, but it seems more easy to implement. In fact I've started a draft of second solution and it seems to work okey so far: surface mapping, move, resize and decoration all work as expected [2]. I'm pasting the new private protocol to discuss here. I'm sure there's a lot to do (for instance the connection protocol and its set up) but maybe now we could talk whether this is really feasible or not for our purposes? Please comment on, thanks! protocol name=xwayland interface name=xserver_connect version=1 description summary=handle X server XWayland start-up connections Used by Xwayland X server only. /description event name=wm description summary=send window manager socket fd This is one tip of the opened socket pair; the other has to be sent via wm_connect interface in order to plug both X server and Xwayland Window Manager. This event must be used only once. /description arg name=fd type=fd/ /event event name=client description summary=send client to be listened on opened fd In principle, this is used to send the first real client to XWayland, the one that triggered its initialization but had to wait for the Window Manager (WM) gets connected before. A good practice is to forward this event when WM is bound, meaning that it's ready to sniff other clients. /description arg name=fd type=fd/ /event /interface interface name=xserver version=1 request name=set_window_id arg name=surface type=object interface=wl_surface/ arg name=id type=uint/ /request /interface interface name=wm_connect version=1 description summary=handle Xwayland Window Manager start-up connections Used by Xwayland Window Manager only. /description event name=xserver description summary=send Xwayland socket fd This is the other tip of the socket pair. /description arg name=fd type=fd/ /event /interface interface name=wm version=1 enum name=window entry name=inactive value=0x1 summary=do not set keyboard focus/ /enum request name=set_window description summary=specify window id, geometries and positioning Teaches the compositor about the window id and its configuration regarding size and location on the screen. The compositor is responsible for looking the surface based on the id and map it on the screen. The x and y arguments specify the global position of the surface on the current output -- exactly how X11 works. The flags argument is used to control whether the surface will receive the keyboard focus or not, after being mapped. /description arg
weston 0.95 on 945GME using i915 drm
Please point me in the right direction to get weston up from the virtual terminal. I have 0.95 currently working under X, but not DRM or wayland from a virtual tty. ( I am new, how do you refer to the vtty wayland EGL platform? ) ( I have mesa master currently running mesa egl demos from the tty ) I have installed and tested the following configuration: ENVIRONMENT export WLD=/home/bcpl/install # change this to another location if you prefer export LD_LIBRARY_PATH=$WLD/lib export PKG_CONFIG_PATH=$WLD/lib/pkgconfig/:$WLD/share/pkgconfig/:/usr/lib/pkgconfig/:/usr/share/pkgconfig/ export ACLOCAL=aclocal -I $WLD/share/aclocal export MESA_DEBUG=1 export EGL_LOG_LEVEL=debug export EGL_DRIVERS_PATH=$WLD/lib #export EGL_PLATFORM=drm #export EGL_PLATFORM=fbdev #export EGL_PLATFORM=wayland export LIBGL_DEBUG=verbose export WAYLAND_DEBUG=1 export XDG_RUNTIME_DIR=/home/bcpl/wayland/xdg #export XDG_RUNTIME_DIR=/tmp/ #export CFLAGS=-g -I${WLD}/include -DEBUG -DHAVE_PIPE_LOADER_DRM #export CXXFLAGS=-g -I${WLD}/include -DEBUG -DHAVE_PIPE_LOADER_DRM export CFLAGS=-g -I${WLD}/include -DEBUG export CXXFLAGS=-g -I${WLD}/include -DEBUG export LDLAGS=-g -ldl #sudo groupadd weston-launch #sudo usermod -a -G weston-launch $USER ## Log all the way out (of X, etc.) #sudo chown root weston-launch #sudo chmod +s weston-launch MESA $ ./configure --prefix=/home/bcpl/install --enable-egl --enable-gles1 --enable-gles2 --with-egl-platforms=drm,wayland,x11,fbdev --enable-shared-glapi --with-dri-drivers=i915,i965,r200,swrast --enable-gbm --with-gallium-drivers=i915,swrast,nouveau --enable-gallium-egl Note: I could not get eglgears_screen working without the gallium drivers AND I could not get gallium drm to compile without the HAVE_PIPE_LOADER_DRM symbol AND I could not get that symbol configured without enabling the nouveau driver. here is the EGL debug info: Note: it selects gallium for the best driver: bcpl@localhost ~]$ source ~/wayland/wld.rc [bcpl@localhost ~]$ ./mesa-demos-8.0.1/src/egl/opengles1/torus_screen libEGL debug: Native platform type: drm (build-time configuration) libEGL debug: EGL search path is /home/bcpl/install/lib:/home/bcpl/install/lib/egl libEGL debug: added /home/bcpl/install/lib/egl/egl_gallium.so to module array libEGL debug: added egl_dri2 to module array libEGL debug: added egl_glx to module array libEGL debug: dlopen(/home/bcpl/install/lib/egl/egl_gallium.so) libEGL info: use DRM for display (nil) libEGL debug: the best driver is Gallium EGL_VERSION = 1.4 (Gallium) Mesa warning: couldn't open libtxc_dxtn.so, software DXTn compression/decompression unavailable Found 1 modes: 0: 1024 x 768 Will use screen size: 1024 x 768 979 frames in 5.0 seconds = 195.761 FPS (FBDEV also works as root) WAYLAND/WESTON I could only get wayland/weston 0.95 to compile against the mesa master branch. I could not get 0.85 to compile against Mesa-8.0.(0,1,2,3,4) Running weston with an X server up and DISPLAY set works! When I switch to the terminal and run ~/install/bin/weston the machine hangs until I ssh in and kill weston. this time DRI2 is selected before respawning and setting EGL_PLATFORM to wayland. I will be focusing here unless directed otherwise: [11:45:07.736] libwayland: disconnect from client 0x856c1d0 wl_drm@11: error 2: invalid name Here is the entire weston output: [bcpl@localhost bin]$ cat weston.log Date: 2012-08-10 UTC [11:45:05.191] weston 0.95.0 http://wayland.freedesktop.org/ Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=weston Build: 0.95.0-76-g3d89049-dirty config-parser: Handle lines that don't end in (2012-08-03 21:56:41 -0400) [11:45:05.192] OS: Linux, 2.6.32-220.el6.i686, #1 SMP Wed Nov 9 08:02:18 EST 2011, i686 [11:45:05.192] Loading module '/home/bcpl/install/lib/weston/drm-backend.so' [11:45:05.193] initializing drm backend [11:45:05.194] using /dev/dri/card0 libGL: Can't open configuration file /etc/drirc: No such file or directory. libEGL debug: Native platform type: drm (autodetected) libEGL debug: EGL search path is /home/bcpl/install/lib:/home/bcpl/install/lib/egl libEGL debug: added /home/bcpl/install/lib/egl/egl_gallium.so to module array libEGL debug: added egl_dri2 to module array libEGL debug: added egl_glx to module array libEGL debug: dlopen(/home/bcpl/install/lib/egl/egl_gallium.so) libEGL info: use DRM for display 0x82c1e18 libEGL debug: EGL user error 0x3001 (EGL_NOT_INITIALIZED) in eglInitialize(no usable display) libEGL debug: the best driver is DRI2 libGL: Can't open configuration file /etc/drirc: No such file or directory. Mesa warning: couldn't open libtxc_dxtn.so, software DXTn compression/decompression unavailable [11:45:05.218] EGL version: 1.4 (DRI2) [11:45:05.218] EGL vendor: Mesa Project [11:45:05.218] EGL client APIs: OpenGL OpenGL_ES OpenGL_ES2 [11:45:05.218] EGL extensions: EGL_MESA_drm_image EGL_WL_bind_wayland_display EGL_KHR_image_base
Re: weston 0.95 on 945GME using i915 drm
On Fri, 10 Aug 2012 08:15:01 -0400 jegde jedge bubba...@gmail.com wrote: Please point me in the right direction to get weston up from the virtual terminal. I have 0.95 currently working under X, but not DRM or wayland from a virtual tty. ( I am new, how do you refer to the vtty wayland EGL platform? ) ( I have mesa master currently running mesa egl demos from the tty ) I have installed and tested the following configuration: ENVIRONMENT export WLD=/home/bcpl/install # change this to another location if you prefer export LD_LIBRARY_PATH=$WLD/lib export PKG_CONFIG_PATH=$WLD/lib/pkgconfig/:$WLD/share/pkgconfig/:/usr/lib/pkgconfig/:/usr/share/pkgconfig/ export ACLOCAL=aclocal -I $WLD/share/aclocal export MESA_DEBUG=1 export EGL_LOG_LEVEL=debug export EGL_DRIVERS_PATH=$WLD/lib #export EGL_PLATFORM=drm #export EGL_PLATFORM=fbdev #export EGL_PLATFORM=wayland export LIBGL_DEBUG=verbose export WAYLAND_DEBUG=1 export XDG_RUNTIME_DIR=/home/bcpl/wayland/xdg #export XDG_RUNTIME_DIR=/tmp/ #export CFLAGS=-g -I${WLD}/include -DEBUG -DHAVE_PIPE_LOADER_DRM #export CXXFLAGS=-g -I${WLD}/include -DEBUG -DHAVE_PIPE_LOADER_DRM export CFLAGS=-g -I${WLD}/include -DEBUG export CXXFLAGS=-g -I${WLD}/include -DEBUG export LDLAGS=-g -ldl #sudo groupadd weston-launch #sudo usermod -a -G weston-launch $USER ## Log all the way out (of X, etc.) #sudo chown root weston-launch #sudo chmod +s weston-launch MESA $ ./configure --prefix=/home/bcpl/install --enable-egl --enable-gles1 --enable-gles2 --with-egl-platforms=drm,wayland,x11,fbdev --enable-shared-glapi --with-dri-drivers=i915,i965,r200,swrast --enable-gbm --with-gallium-drivers=i915,swrast,nouveau --enable-gallium-egl For intel, I think you should use the dri driver, not gallium. If EGL chooses egl_gallium as the driver, it can only load the wrong i915 driver, if any. So you could change to --disable-gallium-egl, too. Also make sure you never set EGL_PLATFORM to anything, and use weston-launch to start Weston. Thanks, pq ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH] shell: show input panel on configure, if activated
On Fri, Aug 10, 2012 at 10:42:54AM +0200, Philipp Brüschweiler wrote: I'm not sure what this is fixing (it's always good to point that out in the commit message). We don't want to show the input panel on configure, ie when the keyboard attaches a buffer to the surface. We only show it when some application requests the OSK... Kristian src/shell.c | 29 + 1 Datei geändert, 17 Zeilen hinzugefügt(+), 12 Zeilen entfernt(-) diff --git a/src/shell.c b/src/shell.c index 9c8a8a9..670cfd6 100644 --- a/src/shell.c +++ b/src/shell.c @@ -2520,13 +2520,22 @@ unlock(struct wl_listener *listener, void *data) } static void +show_input_panel(struct desktop_shell *shell, struct weston_surface *surface) +{ + wl_list_insert(shell-input_panel_layer.surface_list, +surface-layer_link); + weston_surface_assign_output(surface); + weston_surface_damage(surface); + weston_slide_run(surface, surface-geometry.height, 0, NULL, NULL); +} + +static void show_input_panels(struct wl_listener *listener, void *data) { struct desktop_shell *shell = container_of(listener, struct desktop_shell, show_input_panel_listener); struct input_panel_surface *surface, *next; - struct weston_surface *ws; shell-showing_input_panels = true; @@ -2534,14 +2543,8 @@ show_input_panels(struct wl_listener *listener, void *data) shell-input_panel_layer.link); wl_list_for_each_safe(surface, next, - shell-input_panel.surfaces, link) { - ws = surface-surface; - wl_list_insert(shell-input_panel_layer.surface_list, -ws-layer_link); - weston_surface_assign_output(ws); - weston_surface_damage(ws); - weston_slide_run(ws, ws-geometry.height, 0, NULL, NULL); - } + shell-input_panel.surfaces, link) + show_input_panel(shell, surface-surface); } static void @@ -2905,17 +2908,19 @@ static void input_panel_configure(struct weston_surface *surface, int32_t sx, int32_t sy) { struct weston_mode *mode = surface-output-current; + struct desktop_shell *shell = surface-private; + GLfloat x = (mode-width - surface-buffer-width) / 2; GLfloat y = mode-height - surface-buffer-height; - /* Don't map the input panel here, wait for - * show_input_panels signal. */ - weston_surface_configure(surface, surface-output-x + x, surface-output-y + y, surface-buffer-width, surface-buffer-height); + + if (!surface-layer_link.next || wl_list_empty(surface-layer_link)) + show_input_panel(shell, surface); } static void -- 1.7.11.4 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH] shell: show input panel on configure, if activated
Yes, sorry about that. I should have written that into the commit message. I'm not sure if you'd categorize this patch as a fix or a feature. Try the following: - start an editor - click into a text field - start a keyboard Notice that the keyboard doesn't appear until you click the other input field of the editor (even though input methods and panels are supposed to be activated). This patch fixes that. Cheers, Philipp On Fri, Aug 10, 2012 at 4:19 PM, Kristian Høgsberg hoegsb...@gmail.com wrote: On Fri, Aug 10, 2012 at 10:42:54AM +0200, Philipp Brüschweiler wrote: I'm not sure what this is fixing (it's always good to point that out in the commit message). We don't want to show the input panel on configure, ie when the keyboard attaches a buffer to the surface. We only show it when some application requests the OSK... Kristian src/shell.c | 29 + 1 Datei geändert, 17 Zeilen hinzugefügt(+), 12 Zeilen entfernt(-) diff --git a/src/shell.c b/src/shell.c index 9c8a8a9..670cfd6 100644 --- a/src/shell.c +++ b/src/shell.c @@ -2520,13 +2520,22 @@ unlock(struct wl_listener *listener, void *data) } static void +show_input_panel(struct desktop_shell *shell, struct weston_surface *surface) +{ + wl_list_insert(shell-input_panel_layer.surface_list, +surface-layer_link); + weston_surface_assign_output(surface); + weston_surface_damage(surface); + weston_slide_run(surface, surface-geometry.height, 0, NULL, NULL); +} + +static void show_input_panels(struct wl_listener *listener, void *data) { struct desktop_shell *shell = container_of(listener, struct desktop_shell, show_input_panel_listener); struct input_panel_surface *surface, *next; - struct weston_surface *ws; shell-showing_input_panels = true; @@ -2534,14 +2543,8 @@ show_input_panels(struct wl_listener *listener, void *data) shell-input_panel_layer.link); wl_list_for_each_safe(surface, next, - shell-input_panel.surfaces, link) { - ws = surface-surface; - wl_list_insert(shell-input_panel_layer.surface_list, -ws-layer_link); - weston_surface_assign_output(ws); - weston_surface_damage(ws); - weston_slide_run(ws, ws-geometry.height, 0, NULL, NULL); - } + shell-input_panel.surfaces, link) + show_input_panel(shell, surface-surface); } static void @@ -2905,17 +2908,19 @@ static void input_panel_configure(struct weston_surface *surface, int32_t sx, int32_t sy) { struct weston_mode *mode = surface-output-current; + struct desktop_shell *shell = surface-private; + GLfloat x = (mode-width - surface-buffer-width) / 2; GLfloat y = mode-height - surface-buffer-height; - /* Don't map the input panel here, wait for - * show_input_panels signal. */ - weston_surface_configure(surface, surface-output-x + x, surface-output-y + y, surface-buffer-width, surface-buffer-height); + + if (!surface-layer_link.next || wl_list_empty(surface-layer_link)) + show_input_panel(shell, surface); } static void -- 1.7.11.4 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH 0/5] Fix text_model/input_method wl_seat relation
From: Jan Arne Petersen jpeter...@openismus.com Some smaller text_model related cleanups. Add wl_seat and wl_surface arguments to the text_model_activate request. Assign the text_model to the wl_seat and listen to focus change events to deactivate the text_model when the wl_surface looses keyboard focus. Jan Arne Petersen (5): text: Add missing callbacks for text_model events text: Rename text_model_manager to factory text: Add activate/deactivate events text: Assign text_model to a wl_seat text: Deactivate text_model on keyboard focus lost clients/editor.c | 121 -- protocol/text.xml | 15 -- src/compositor.c | 2 +- src/compositor.h | 6 ++- src/text-backend.c | 137 +++-- 5 files changed, 215 insertions(+), 66 deletions(-) -- 1.7.11.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH 3/5] text: Add activate/deactivate events
From: Jan Arne Petersen jpeter...@openismus.com Let the client know when a text model gets activated or deactiavted. --- clients/editor.c | 45 + protocol/text.xml | 4 +++- src/text-backend.c | 10 ++ 3 files changed, 42 insertions(+), 17 deletions(-) diff --git a/clients/editor.c b/clients/editor.c index 8f0e9d8..9cb7326 100644 --- a/clients/editor.c +++ b/clients/editor.c @@ -107,6 +107,28 @@ text_model_locale(void *data, { } +static void +text_model_activated(void *data, +struct text_model *text_model) +{ + struct text_entry *entry = data; + + entry-active = 1; + + widget_schedule_redraw(entry-widget); +} + +static void +text_model_deactivated(void *data, + struct text_model *text_model) +{ + struct text_entry *entry = data; + + entry-active = 0; + + widget_schedule_redraw(entry-widget); +} + static const struct text_model_listener text_model_listener = { text_model_commit_string, text_model_preedit_string, @@ -114,7 +136,9 @@ static const struct text_model_listener text_model_listener = { text_model_key, text_model_selection_replacement, text_model_direction, - text_model_locale + text_model_locale, + text_model_activated, + text_model_deactivated }; static struct text_entry* @@ -283,24 +307,13 @@ button_handler(struct widget *widget, assert(!(activate_entry activate_editor)); if (activate_entry) { - if (editor-editor-active) - text_entry_deactivate(editor-editor); - if (!editor-entry-active) - text_entry_activate(editor-entry); + text_entry_activate(editor-entry); } else if (activate_editor) { - if (editor-entry-active) - text_entry_deactivate(editor-entry); - if (!editor-editor-active) - text_entry_activate(editor-editor); + text_entry_activate(editor-editor); } else { - if (editor-entry-active) - text_entry_deactivate(editor-entry); - if (editor-editor-active) - text_entry_deactivate(editor-editor); + text_entry_deactivate(editor-entry); + text_entry_deactivate(editor-editor); } - editor-entry-active = activate_entry; - editor-editor-active = activate_editor; - assert(!(editor-entry-active editor-editor-active)); widget_schedule_redraw(widget); } diff --git a/protocol/text.xml b/protocol/text.xml index 54866e1..ac12a1a 100644 --- a/protocol/text.xml +++ b/protocol/text.xml @@ -33,7 +33,9 @@ event name=key/ event name=selection_replacement/ event name=direction/ -event name=locale/ +event name=locale/ +event name=activated/ +event name=deactivated/ /interface interface name=text_model_factory version=1 diff --git a/src/text-backend.c b/src/text-backend.c index bed3f77..9113c9b 100644 --- a/src/text-backend.c +++ b/src/text-backend.c @@ -54,6 +54,7 @@ deactivate_text_model(struct text_model *text_model) if (text_model-input_method-active_model == text_model) { text_model-input_method-active_model = NULL; wl_signal_emit(ec-hide_input_panel_signal, ec); + text_model_send_deactivated(text_model-resource); } } @@ -90,9 +91,18 @@ text_model_activate(struct wl_client *client, struct text_model *text_model = resource-data; struct weston_compositor *ec = text_model-input_method-ec; + if (text_model-input_method-active_model) { + if (text_model-input_method-active_model == text_model) + return; + + deactivate_text_model(text_model-input_method-active_model); + } + text_model-input_method-active_model = text_model; wl_signal_emit(ec-show_input_panel_signal, ec); + + text_model_send_activated(text_model-resource); } static void -- 1.7.11.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH 4/5] text: Assign text_model to a wl_seat
From: Jan Arne Petersen jpeter...@openismus.com Add a wl_seat argument to the activate and deactivate requests of text_method. On activation a text_model gets assigned to the input_method of the wl_seat specified in the activate request. --- clients/editor.c | 28 +++--- protocol/text.xml | 9 +-- src/compositor.c | 2 +- src/compositor.h | 6 - src/text-backend.c | 70 -- 5 files changed, 75 insertions(+), 40 deletions(-) diff --git a/clients/editor.c b/clients/editor.c index 9cb7326..a5347fe 100644 --- a/clients/editor.c +++ b/clients/editor.c @@ -33,6 +33,7 @@ struct text_entry { struct widget *widget; + struct window *window; char *text; int active; struct rectangle allocation; @@ -152,6 +153,7 @@ text_entry_create(struct editor *editor, const char *text) surface = window_get_wl_surface(editor-window); entry-widget = editor-widget; + entry-window = editor-window; entry-text = strdup(text); entry-active = 0; entry-model = text_model_factory_create_text_model(editor-text_model_factory, surface); @@ -271,15 +273,22 @@ rectangle_contains(struct rectangle *rectangle, int32_t x, int32_t y) } static void -text_entry_activate(struct text_entry *entry) +text_entry_activate(struct text_entry *entry, +struct wl_seat *seat) { - text_model_activate(entry-model); + struct wl_surface *surface = window_get_wl_surface(entry-window); + + text_model_activate(entry-model, + seat, + surface); } static void -text_entry_deactivate(struct text_entry *entry) +text_entry_deactivate(struct text_entry *entry, + struct wl_seat *seat) { - text_model_deactivate(entry-model); + text_model_deactivate(entry-model, + seat); } static void @@ -291,6 +300,7 @@ button_handler(struct widget *widget, struct editor *editor = data; struct rectangle allocation; int32_t x, y; + struct wl_seat *seat; if (state != WL_POINTER_BUTTON_STATE_PRESSED || button != BTN_LEFT) { return; @@ -306,13 +316,15 @@ button_handler(struct widget *widget, int32_t activate_editor = rectangle_contains(editor-editor-allocation, x, y); assert(!(activate_entry activate_editor)); + seat = input_get_seat(input); + if (activate_entry) { - text_entry_activate(editor-entry); + text_entry_activate(editor-entry, seat); } else if (activate_editor) { - text_entry_activate(editor-editor); + text_entry_activate(editor-editor, seat); } else { - text_entry_deactivate(editor-entry); - text_entry_deactivate(editor-editor); + text_entry_deactivate(editor-entry, seat); + text_entry_deactivate(editor-editor, seat); } widget_schedule_redraw(widget); diff --git a/protocol/text.xml b/protocol/text.xml index ac12a1a..e73cacb 100644 --- a/protocol/text.xml +++ b/protocol/text.xml @@ -6,8 +6,13 @@ request name=set_cursor_index arg name=index type=uint/ /request -request name=activate/ -request name=deactivate/ +request name=activate + arg name=seat type=object interface=wl_seat/ + arg name=surface type=object interface=wl_surface/ +/request +request name=deactivate + arg name=seat type=object interface=wl_seat/ +/request request name=set_selected_text arg name=text type=string/ arg name=index type=int/ diff --git a/src/compositor.c b/src/compositor.c index 34df5f7..f6e67eb 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -2632,6 +2632,7 @@ weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec) seat-new_drag_icon_listener); clipboard_create(seat); + input_method_create(ec, seat); } WL_EXPORT void @@ -3183,7 +3184,6 @@ weston_compositor_init(struct weston_compositor *ec, screenshooter_create(ec); text_cursor_position_notifier_create(ec); - input_method_create(ec); wl_data_device_manager_init(ec-wl_display); diff --git a/src/compositor.h b/src/compositor.h index 47301fa..acf38a4 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -47,6 +47,7 @@ struct weston_surface; struct shell_surface; struct weston_seat; struct weston_output; +struct input_method; enum weston_keyboard_modifier { MODIFIER_CTRL = (1 0), @@ -235,6 +236,8 @@ struct weston_seat { struct xkb_state *state; enum weston_led leds; } xkb_state; + + struct input_method *input_method; }; struct weston_shader { @@ -742,7 +745,8 @@ void text_cursor_position_notifier_create(struct weston_compositor *ec); void
[PATCH 5/5] text: Deactivate text_model on keyboard focus lost
From: Jan Arne Petersen jpeter...@openismus.com Assign a surface to a text_model on the text_model_activate request and deactivate the text_model when the surface looses the keyboard focus. --- src/text-backend.c | 43 +++ 1 file changed, 43 insertions(+) diff --git a/src/text-backend.c b/src/text-backend.c index c634aec..ddeec20 100644 --- a/src/text-backend.c +++ b/src/text-backend.c @@ -33,6 +33,8 @@ struct text_model { struct weston_compositor *ec; struct wl_list input_methods; + + struct wl_surface *surface; }; struct input_method { @@ -45,8 +47,14 @@ struct input_method { struct text_model *model; struct wl_list link; + + struct wl_listener keyboard_focus_listener; + + int focus_listener_initialized; }; +static void input_method_init_seat(struct weston_seat *seat); + static void deactivate_text_model(struct text_model *text_model, struct input_method *input_method) @@ -109,6 +117,9 @@ text_model_activate(struct wl_client *client, weston_seat-input_method-model = text_model; wl_list_insert(text_model-input_methods, weston_seat-input_method-link); + input_method_init_seat(weston_seat); + + text_model-surface = surface-data; wl_signal_emit(ec-show_input_panel_signal, ec); @@ -275,6 +286,36 @@ input_method_notifier_destroy(struct wl_listener *listener, void *data) free(input_method); } +static void +handle_keyboard_focus(struct wl_listener *listener, void *data) +{ + struct wl_keyboard *keyboard = data; + struct input_method *input_method = + container_of(listener, struct input_method, keyboard_focus_listener); + struct wl_surface *surface = keyboard-focus; + + if (!input_method-model) + return; + + if (!surface || input_method-model-surface != surface) + deactivate_text_model(input_method-model, + input_method); +} + +static void +input_method_init_seat(struct weston_seat *seat) +{ + if (seat-input_method-focus_listener_initialized) + return; + + if (seat-has_keyboard) { + seat-input_method-keyboard_focus_listener.notify = handle_keyboard_focus; + wl_signal_add(seat-seat.keyboard-focus_signal, seat-input_method-keyboard_focus_listener); + } + + seat-input_method-focus_listener_initialized = 1; +} + void input_method_create(struct weston_compositor *ec, struct weston_seat *seat) @@ -285,6 +326,7 @@ input_method_create(struct weston_compositor *ec, input_method-ec = ec; input_method-model = NULL; + input_method-focus_listener_initialized = 0; input_method-input_method_global = wl_display_add_global(ec-wl_display, @@ -301,3 +343,4 @@ input_method_create(struct weston_compositor *ec, seat-input_method = input_method; } + -- 1.7.11.2 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: weston 0.95 on 945GME using i915 drm
Thank you for your help. It looks like I have a dri/mesa issue to resolve before I can run weston... Is there a resource that shows how to get mesa egl/dri/drm working on i915? I rebuilt (make clean, make, make install) mesa, then pixman, then cairo, then weston. When I recompile mesa with --disable-gallium-egl, I now fail where gallium works: [code]code [bcpl@localhost ~]$ source wayland/wld.rc [bcpl@localhost ~]$ ./mesa-demos-8.0.1/src/egl/opengles1/torus_screen libEGL debug: Native platform type: drm (build-time configuration) libEGL debug: EGL search path is /home/bcpl/install/lib:/home/bcpl/install/lib/egl libEGL debug: added egl_dri2 to module array libEGL debug: added egl_glx to module array libEGL debug: the best driver is DRI2 EGL_VERSION = 1.4 (DRI2) libEGL debug: attribute 0x3033 has an invalid value 0x8 libEGL debug: EGL user error 0x3004 (EGL_BAD_ATTRIBUTE) in eglChooseConfig EGLUT: failed to choose a config /code[/code] When I run with weston-launch i get: failed to get cairo egl argb device failed to create display: Invalid argument [code]code [bcpl@localhost bin]$ source ~/wayland/wld.rc [bcpl@localhost bin]$ ./weston-launch Date: 2012-08-10 UTC [14:41:13.327] weston 0.95.0 http://wayland.freedesktop.org/ Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=weston Build: 0.95.0-76-g3d89049-dirty config-parser: Handle lines that don't end in (2012-08-03 21:56:41 -0400) [14:41:13.327] OS: Linux, 2.6.32-220.el6.i686, #1 SMP Wed Nov 9 08:02:18 EST 2011, i686 [14:41:13.329] Loading module '/home/bcpl/install/lib/weston/drm-backend.so' [14:41:13.330] initializing drm backend [14:41:13.337] using /dev/dri/card0 libEGL debug: Native platform type: drm (autodetected) libEGL debug: EGL search path is /home/bcpl/install/lib:/home/bcpl/install/lib/egl libEGL debug: added egl_dri2 to module array libEGL debug: added egl_glx to module array libEGL debug: the best driver is DRI2 Mesa warning: couldn't open libtxc_dxtn.so, software DXTn compression/decompression unavailable [14:41:13.361] EGL version: 1.4 (DRI2) [14:41:13.361] EGL vendor: Mesa Project [14:41:13.361] EGL client APIs: OpenGL OpenGL_ES OpenGL_ES2 [14:41:13.361] EGL extensions: EGL_MESA_drm_image EGL_WL_bind_wayland_display EGL_KHR_image_base EGL_KHR_gl_renderbuffer_image EGL_KHR_surfaceless_context [14:41:13.361] GL version: OpenGL ES 2.0 Mesa 8.1-devel (git-04a11b5) [14:41:13.361] GLSL version: OpenGL ES GLSL ES 1.0.16 [14:41:13.361] GL vendor: VMware, Inc. [14:41:13.361] GL renderer: Gallium 0.4 on i915 (chipset: 945GME) [14:41:13.361] GL extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_npot GL_OES_EGL_image GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV GL_EXT_read_format_bgra GL_NV_fbo_color_attachments GL_OES_EGL_image_external GL_EXT_unpack_subimage GL_NV_draw_buffers GL_NV_read_buffer [14:41:13.413] failed to get plane resources: Invalid argument [14:41:13.413] Output LVDS1, (connector 5, crtc 4) mode 1024x768@60.0, preferred, current mode 1024x768@60.0 [14:41:13.833] input device Power Button, /dev/input/event2 is a keyboard [14:41:13.836] input device Sleep Button, /dev/input/event0 is a keyboard [14:41:13.839] input device Power Button, /dev/input/event1 is a keyboard [14:41:13.845] input device Interlink Electronics, Inc. FSR 4ZUSB, /dev/input/event8 is a pointer [14:41:13.848] input device DRS Inc. DRS Inc. Keyboard, /dev/input/event9 is a keyboard [14:41:13.851] input device Hampshire Company TSHARC Analog Resistive, /dev/input/event5 is a pointer [14:41:13.854] input device Dell Dell USB Optical Mouse, /dev/input/event11 is a pointer [14:41:13.862] input device Dell Dell Wired Multimedia Keyboard, /dev/input/event6 is a keyboard [14:41:13.865] input device Dell Dell Wired Multimedia Keyboard, /dev/input/event7 is a pointer [14:41:13.865] input device Dell Dell Wired Multimedia Keyboard, /dev/input/event7 is a keyboard [14:41:13.868] input device AT Translated Set 2 keyboard, /dev/input/event4 is a keyboard [14:41:13.871] input device Macintosh mouse button emulation, /dev/input/event3 is a pointer [14:41:13.871] Loading module '/home/bcpl/install/lib/weston/desktop-shell.so' [14:41:13.879] libwayland: using socket /home/bcpl/wayland/xdg/wayland-0 libEGL debug: Native platform type: wayland (autodetected) libEGL debug: EGL search path is /home/bcpl/install/lib:/home/bcpl/install/lib/egl libEGL debug: added egl_dri2 to module array libEGL debug: added egl_glx to module array libEGL debug: pci
Re: weston 0.95 on 945GME using i915 drm
On Fri, 10 Aug 2012 11:11:14 -0400 jegde jedge bubba...@gmail.com wrote: I rebuilt (make clean, make, make install) mesa, then pixman, then cairo, then weston. Hi, only Mesa rebuild is needed at this point. When I recompile mesa with --disable-gallium-egl, I now fail where gallium works: [code]code [bcpl@localhost ~]$ source wayland/wld.rc [bcpl@localhost ~]$ ./mesa-demos-8.0.1/src/egl/opengles1/torus_screen libEGL debug: Native platform type: drm (build-time configuration) libEGL debug: EGL search path is /home/bcpl/install/lib:/home/bcpl/install/lib/egl libEGL debug: added egl_dri2 to module array libEGL debug: added egl_glx to module array libEGL debug: the best driver is DRI2 EGL_VERSION = 1.4 (DRI2) libEGL debug: attribute 0x3033 has an invalid value 0x8 libEGL debug: EGL user error 0x3004 (EGL_BAD_ATTRIBUTE) in eglChooseConfig Yes, it is trying to use the gallium driver still. [bcpl@localhost bin]$ ./weston-launch Date: 2012-08-10 UTC [14:41:13.327] weston 0.95.0 http://wayland.freedesktop.org/ Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=weston Build: 0.95.0-76-g3d89049-dirty config-parser: Handle lines that don't end in (2012-08-03 21:56:41 -0400) [14:41:13.327] OS: Linux, 2.6.32-220.el6.i686, #1 SMP Wed Nov 9 08:02:18 EST 2011, i686 [14:41:13.329] Loading module '/home/bcpl/install/lib/weston/drm-backend.so' [14:41:13.330] initializing drm backend [14:41:13.337] using /dev/dri/card0 libEGL debug: Native platform type: drm (autodetected) libEGL debug: EGL search path is /home/bcpl/install/lib:/home/bcpl/install/lib/egl libEGL debug: added egl_dri2 to module array libEGL debug: added egl_glx to module array libEGL debug: the best driver is DRI2 Mesa warning: couldn't open libtxc_dxtn.so, software DXTn compression/decompression unavailable [14:41:13.361] EGL version: 1.4 (DRI2) [14:41:13.361] EGL vendor: Mesa Project [14:41:13.361] EGL client APIs: OpenGL OpenGL_ES OpenGL_ES2 [14:41:13.361] EGL extensions: EGL_MESA_drm_image EGL_WL_bind_wayland_display EGL_KHR_image_base EGL_KHR_gl_renderbuffer_image EGL_KHR_surfaceless_context [14:41:13.361] GL version: OpenGL ES 2.0 Mesa 8.1-devel (git-04a11b5) [14:41:13.361] GLSL version: OpenGL ES GLSL ES 1.0.16 [14:41:13.361] GL vendor: VMware, Inc. [14:41:13.361] GL renderer: Gallium 0.4 on i915 (chipset: 945GME) The above line should not say Gallium. Just drop the i915 from the gallium driver list on the Mesa configure line, and keep it in the dri driver list. Also the configure line from http://wayland.freedesktop.org/building.html should work just fine. Intel dri drivers get built by default, when they are not explicitly configured. Make sure to wipe all intel drivers from your install prefix before you install Mesa again, so that the intel gallium driver does not remain there. Actually, simply removing the intel gallium driver should be enough, no need to even rebuild, I guess. -- Pekka Paalanen http://www.iki.fi/pq/ ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: weston 0.95 on 945GME using i915 drm
Thanks again. I Really appreciate the help. I wiped everything, started from scratch, and followed the build instructions at http://wayland.freedesktop.org/building.html verbatim. With this mesa build I cannot get any mesa-demo-8.0.1/src/egl/opengl/demo_screen example to run from the tty console. The ~/src/egl/opengl/demo_x11 examples do work linking these specific mesa libs. Here are the results from the weston-launch: [bcpl@localhost bin]$ cat weston.log Date: 2012-08-10 UTC [17:39:58.209] weston 0.95.0 http://wayland.freedesktop.org/ Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=weston Build: [17:39:58.209] OS: Linux, 2.6.32-220.el6.i686, #1 SMP Wed Nov 9 08:02:18 EST 2011, i686 [17:39:58.211] Loading module '/home/bcpl/install/lib/weston/drm-backend.so' [17:39:58.211] initializing drm backend [17:39:58.218] using /dev/dri/card0 libEGL debug: Native platform type: drm (autodetected) libEGL debug: EGL search path is /home/bcpl/install/lib:/home/bcpl/install/lib/egl libEGL debug: added egl_dri2 to module array libEGL debug: added egl_glx to module array libEGL debug: the best driver is DRI2 Mesa warning: couldn't open libtxc_dxtn.so, software DXTn compression/decompression unavailable [17:39:58.238] EGL version: 1.4 (DRI2) [17:39:58.238] EGL vendor: Mesa Project [17:39:58.238] EGL client APIs: OpenGL OpenGL_ES2 [17:39:58.238] EGL extensions: EGL_MESA_drm_image EGL_WL_bind_wayland_display EGL_KHR_image_base EGL_KHR_gl_renderbuffer_image EGL_KHR_surfaceless_context [17:39:58.238] GL version: OpenGL ES 2.0 Mesa 8.1-devel (git-f7af4be) [17:39:58.238] GLSL version: OpenGL ES GLSL ES 1.0.16 [17:39:58.238] GL vendor: Intel Open Source Technology Center [17:39:58.238] GL renderer: Mesa DRI Intel(R) 945GME x86/MMX/SSE2 [17:39:58.238] GL extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_npot GL_OES_EGL_image GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV GL_EXT_read_format_bgra GL_NV_fbo_color_attachments GL_EXT_unpack_subimage GL_NV_draw_buffers GL_NV_read_buffer [17:39:58.292] failed to get plane resources: Invalid argument [17:39:58.292] kms connector 5, crtc 4 mode 1024x768@60.0, preferred, current mode 1024x768@60.0 [17:39:58.736] Loading module '/home/bcpl/install/lib/weston/desktop-shell.so' [17:39:58.743] libwayland: using socket /home/bcpl/wayland/xdg/wayland-0 libEGL debug: Native platform type: wayland (autodetected) libEGL debug: EGL search path is /home/bcpl/install/lib:/home/bcpl/install/lib/egl libEGL debug: added egl_dri2 to module array libEGL debug: added egl_glx to module array libEGL debug: pci id for 5: 8086:27ae, driver i915 libEGL debug: DRI2: dlopen(/home/bcpl/install/lib/dri/i915_dri.so) libEGL debug: DRI2: found extension `DRI_Core' libEGL info: DRI2: found extension DRI_Core version 1 libEGL debug: DRI2: found extension `DRI_DRI2' libEGL info: DRI2: found extension DRI_DRI2 version 3 libEGL debug: DRI2: found extension `DRI_TexBuffer' libEGL info: DRI2: found extension DRI_TexBuffer version 2 libEGL debug: DRI2: found extension `DRI2_Flush' libEGL info: DRI2: found extension DRI2_Flush version 3 libEGL debug: DRI2: found extension `DRI_IMAGE' libEGL info: DRI2: found extension DRI_IMAGE version 5 libEGL debug: DRI2: found extension `DRI_CONFIG_QUERY' libEGL debug: the best driver is DRI2 Mesa warning: couldn't open libtxc_dxtn.so, software DXTn compression/decompression unavailable failed to get cairo egl argb device failed to create display: Invalid argument libEGL debug: Display 0x82dee60 is destroyed with resources [17:39:58.798] libwayland: disconnect from client 0x8c946a0 [17:39:58.799] weston-desktop-shell died, respawning... libEGL debug: Native platform type: wayland (autodetected) libEGL debug: EGL search path is /home/bcpl/install/lib:/home/bcpl/install/lib/egl libEGL debug: added egl_dri2 to module array libEGL debug: added egl_glx to module array libEGL debug: pci id for 5: 8086:27ae, driver i915 libEGL debug: DRI2: dlopen(/home/bcpl/install/lib/dri/i915_dri.so) libEGL debug: DRI2: found extension `DRI_Core' libEGL info: DRI2: found extension DRI_Core version 1 libEGL debug: DRI2: found extension `DRI_DRI2' libEGL info: DRI2: found extension DRI_DRI2 version 3 libEGL debug: DRI2: found extension `DRI_TexBuffer' libEGL info: DRI2: found extension DRI_TexBuffer version 2 libEGL debug: DRI2: found extension `DRI2_Flush' libEGL info: DRI2: found extension DRI2_Flush version 3 libEGL debug: DRI2: found extension
Re: [PATCH 4/5] text: Assign text_model to a wl_seat
This will not work with multiple seats, right? I guess the input_method struct would have to be broken up into a 'global' part (containing the global object bindings) and a per seat part. Or am I missing something? Cheers, Philipp On Fri, Aug 10, 2012 at 4:47 PM, Jan Arne Petersen jpeter...@openismus.com wrote: From: Jan Arne Petersen jpeter...@openismus.com Add a wl_seat argument to the activate and deactivate requests of text_method. On activation a text_model gets assigned to the input_method of the wl_seat specified in the activate request. --- clients/editor.c | 28 +++--- protocol/text.xml | 9 +-- src/compositor.c | 2 +- src/compositor.h | 6 - src/text-backend.c | 70 -- 5 files changed, 75 insertions(+), 40 deletions(-) diff --git a/clients/editor.c b/clients/editor.c index 9cb7326..a5347fe 100644 --- a/clients/editor.c +++ b/clients/editor.c @@ -33,6 +33,7 @@ struct text_entry { struct widget *widget; + struct window *window; char *text; int active; struct rectangle allocation; @@ -152,6 +153,7 @@ text_entry_create(struct editor *editor, const char *text) surface = window_get_wl_surface(editor-window); entry-widget = editor-widget; + entry-window = editor-window; entry-text = strdup(text); entry-active = 0; entry-model = text_model_factory_create_text_model(editor-text_model_factory, surface); @@ -271,15 +273,22 @@ rectangle_contains(struct rectangle *rectangle, int32_t x, int32_t y) } static void -text_entry_activate(struct text_entry *entry) +text_entry_activate(struct text_entry *entry, +struct wl_seat *seat) { - text_model_activate(entry-model); + struct wl_surface *surface = window_get_wl_surface(entry-window); + + text_model_activate(entry-model, + seat, + surface); } static void -text_entry_deactivate(struct text_entry *entry) +text_entry_deactivate(struct text_entry *entry, + struct wl_seat *seat) { - text_model_deactivate(entry-model); + text_model_deactivate(entry-model, + seat); } static void @@ -291,6 +300,7 @@ button_handler(struct widget *widget, struct editor *editor = data; struct rectangle allocation; int32_t x, y; + struct wl_seat *seat; if (state != WL_POINTER_BUTTON_STATE_PRESSED || button != BTN_LEFT) { return; @@ -306,13 +316,15 @@ button_handler(struct widget *widget, int32_t activate_editor = rectangle_contains(editor-editor-allocation, x, y); assert(!(activate_entry activate_editor)); + seat = input_get_seat(input); + if (activate_entry) { - text_entry_activate(editor-entry); + text_entry_activate(editor-entry, seat); } else if (activate_editor) { - text_entry_activate(editor-editor); + text_entry_activate(editor-editor, seat); } else { - text_entry_deactivate(editor-entry); - text_entry_deactivate(editor-editor); + text_entry_deactivate(editor-entry, seat); + text_entry_deactivate(editor-editor, seat); } widget_schedule_redraw(widget); diff --git a/protocol/text.xml b/protocol/text.xml index ac12a1a..e73cacb 100644 --- a/protocol/text.xml +++ b/protocol/text.xml @@ -6,8 +6,13 @@ request name=set_cursor_index arg name=index type=uint/ /request -request name=activate/ -request name=deactivate/ +request name=activate + arg name=seat type=object interface=wl_seat/ + arg name=surface type=object interface=wl_surface/ +/request +request name=deactivate + arg name=seat type=object interface=wl_seat/ +/request request name=set_selected_text arg name=text type=string/ arg name=index type=int/ diff --git a/src/compositor.c b/src/compositor.c index 34df5f7..f6e67eb 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -2632,6 +2632,7 @@ weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec) seat-new_drag_icon_listener); clipboard_create(seat); + input_method_create(ec, seat); } WL_EXPORT void @@ -3183,7 +3184,6 @@ weston_compositor_init(struct weston_compositor *ec, screenshooter_create(ec); text_cursor_position_notifier_create(ec); - input_method_create(ec); wl_data_device_manager_init(ec-wl_display); diff --git a/src/compositor.h b/src/compositor.h index 47301fa..acf38a4 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -47,6 +47,7 @@ struct weston_surface; struct shell_surface; struct weston_seat; struct
Re: [PATCH 4/5] text: Assign text_model to a wl_seat
Hi, On 08/10/2012 08:32 PM, Philipp Brüschweiler wrote: This will not work with multiple seats, right? I guess the input_method struct would have to be broken up into a 'global' part (containing the global object bindings) and a per seat part. Or am I missing something? It should work with multiple seats (with one input_method instance per seat). I do not see a need for a global part, it should be possible to handle everything per seat. Cheers, Philipp On Fri, Aug 10, 2012 at 4:47 PM, Jan Arne Petersen jpeter...@openismus.com wrote: From: Jan Arne Petersen jpeter...@openismus.com Add a wl_seat argument to the activate and deactivate requests of text_method. On activation a text_model gets assigned to the input_method of the wl_seat specified in the activate request. --- clients/editor.c | 28 +++--- protocol/text.xml | 9 +-- src/compositor.c | 2 +- src/compositor.h | 6 - src/text-backend.c | 70 -- 5 files changed, 75 insertions(+), 40 deletions(-) diff --git a/clients/editor.c b/clients/editor.c index 9cb7326..a5347fe 100644 --- a/clients/editor.c +++ b/clients/editor.c @@ -33,6 +33,7 @@ struct text_entry { struct widget *widget; + struct window *window; char *text; int active; struct rectangle allocation; @@ -152,6 +153,7 @@ text_entry_create(struct editor *editor, const char *text) surface = window_get_wl_surface(editor-window); entry-widget = editor-widget; + entry-window = editor-window; entry-text = strdup(text); entry-active = 0; entry-model = text_model_factory_create_text_model(editor-text_model_factory, surface); @@ -271,15 +273,22 @@ rectangle_contains(struct rectangle *rectangle, int32_t x, int32_t y) } static void -text_entry_activate(struct text_entry *entry) +text_entry_activate(struct text_entry *entry, +struct wl_seat *seat) { - text_model_activate(entry-model); + struct wl_surface *surface = window_get_wl_surface(entry-window); + + text_model_activate(entry-model, + seat, + surface); } static void -text_entry_deactivate(struct text_entry *entry) +text_entry_deactivate(struct text_entry *entry, + struct wl_seat *seat) { - text_model_deactivate(entry-model); + text_model_deactivate(entry-model, + seat); } static void @@ -291,6 +300,7 @@ button_handler(struct widget *widget, struct editor *editor = data; struct rectangle allocation; int32_t x, y; + struct wl_seat *seat; if (state != WL_POINTER_BUTTON_STATE_PRESSED || button != BTN_LEFT) { return; @@ -306,13 +316,15 @@ button_handler(struct widget *widget, int32_t activate_editor = rectangle_contains(editor-editor-allocation, x, y); assert(!(activate_entry activate_editor)); + seat = input_get_seat(input); + if (activate_entry) { - text_entry_activate(editor-entry); + text_entry_activate(editor-entry, seat); } else if (activate_editor) { - text_entry_activate(editor-editor); + text_entry_activate(editor-editor, seat); } else { - text_entry_deactivate(editor-entry); - text_entry_deactivate(editor-editor); + text_entry_deactivate(editor-entry, seat); + text_entry_deactivate(editor-editor, seat); } widget_schedule_redraw(widget); diff --git a/protocol/text.xml b/protocol/text.xml index ac12a1a..e73cacb 100644 --- a/protocol/text.xml +++ b/protocol/text.xml @@ -6,8 +6,13 @@ request name=set_cursor_index arg name=index type=uint/ /request -request name=activate/ -request name=deactivate/ +request name=activate + arg name=seat type=object interface=wl_seat/ + arg name=surface type=object interface=wl_surface/ +/request +request name=deactivate + arg name=seat type=object interface=wl_seat/ +/request request name=set_selected_text arg name=text type=string/ arg name=index type=int/ diff --git a/src/compositor.c b/src/compositor.c index 34df5f7..f6e67eb 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -2632,6 +2632,7 @@ weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec) seat-new_drag_icon_listener); clipboard_create(seat); + input_method_create(ec, seat); } WL_EXPORT void @@ -3183,7 +3184,6 @@ weston_compositor_init(struct weston_compositor *ec, screenshooter_create(ec); text_cursor_position_notifier_create(ec); - input_method_create(ec);
Re: weston 0.95 on 945GME using i915 drm
Looks like it is failing in: ~/mesa/egl/main/eglapi.c::eglCreatePBufferSurface() ~/cairo/src/cairo_egl_context.c:: cairo_egl_device_create() ~/weston/clients/window.c::init_egl() ~/weston/clients/window.c::display_create() This means that all the boilerplate egl initialization has completed successfully. I could not yet track what driver/lib has drv-API.CreatePBufferSurface() Don't know what to try next. ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Weston doesn't work with gl enabled cairo on radeon
Ran weston under X, with radeon drivers. Weston ran, desktop shell failed: failed to get cairo egl argb device failed to create display: No such file or directory libEGL debug: Display 0x82fce0 is destroyed with resources [20:52:15.385] libwayland: disconnect from client 0x1de6ff0 [20:52:15.385] weston-desktop-shell died, respawning... Complete output: http://www.chaosreigns.com/wayland/tmp/weston.txt I noticed that error message is wrapped in #ifdef HAVE_CAIRO_EGL, so I tried rebuilding cairo without --enable-gl, and it worked. Is this a bug in weston or cairo? -- For every complex problem, there is a solution that is simple, neat, and wrong. - H. L. Mencken http://www.ChaosReigns.com ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH 2/2 weston] toytoolkit: Don't draw shadows for maximized windows.
This looks really messy and still makes the assumption that the only reason for edges to be removed is because of maximize. It is also completely different than how fullscreen is done, even though that should be identical except the titlebar is also removed for fullscreen. Based on the latest changes to the shell api, I feel the following must be added: 1. The content region. This is the part of the window that does not include the edges. However it *does* include the titlebar. Imagine the part of the window you see when it is maximized. This is different and smaller than the input region and should be specified by clients using a new api very similar to how the input and opaque regions are specified. Shells need this information to property implement snap-to-edge (where the edge is of another window, a panel, or an output), and to implement maximizes other than the full-screen maximize (ie vertically-only). It also means maximize is not a special state, instead the shell just resizes the surface so that the contents fill the output. 2. When the shell tells a client to configure a window, it should communicate both a size for the surface image, and the bounding box of the content region in this new size. This bounding box will always be the same distance or closer to the edges of the surface (ie it is only used to clip edges, not to make them thicker). This allows clients to know that edges are clipped so they do not place any important controls there, and they can adjust their graphics to take into account the clipping (for instance not drawing rounded-corner shading for a clipped-off rounded corner). It will also save some memory and rendering time by clipping these off the allocated image buffer. Ideally this new box should be added to the configure event and we should just require clients to obey it. If this is not allowed due to the api being frozen, it could be a different event, but it suffers from the ugly fact that the size sent with configure is not the actual size the surface should be (because that would make a client that does not clip the edges make the window too small when maximized). 3. Fullscreen: somewhat unrelated, but the shell should be able to directly tell clients to remove all decorations. Currently this is tied into the fullscreen request from a client. This is necessary so shells can force a client to fullscreen. It is also needed for embedding one wayland client in another. It may also be useful for displaying wayland clients on legacy window systems that make it very difficult to remove their own decorations. ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: Weston doesn't work with gl enabled cairo on radeon
darxus@... writes: Is this a bug in weston or cairo? IIt's a bug in Mesa. Try reverting mesa to commit 102617bc5206e459bb1743d2d72341dbfe77bc58 That's what I had to do. ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel