Repository: qtile/qtile

Issue:
Dialog windows have no frames in Gimp
# Issue description
Dialog window frames (borders) are not visible for some programs like Gimp and Intellij Idea. See screenshots below

- Gimp: *File > New*

![gimp_0 15-git](https://user-images.githubusercontent.com/15928203/86031085-128a1780-ba3e-11ea-8876-74531ac5b934.png)

- IntelliJ Idea: *File > New > Project ..*

![intelliJ_Idea_new-project__0 15-git](https://user-images.githubusercontent.com/15928203/86031610-bb387700-ba3e-11ea-9824-be352e449dfc.png)

# Qtile version

latest Qtile git version `0.15.1.dev158+gfb45432b`

# Configuration

can be observed with default qtile configuration.


Discussion:
Can you show an xprop for one of these dialogs?

On Mon, Jun 29, 2020 at 10:37 AM Sergey <notifications@github.com> wrote:

> Issue description
>
> Dialog window frames (borders) are not visible for some programs like Gimp
> and Intellij Idea. See screenshots below
>
>    - Gimp: *File > New*
>
> [image: gimp_0 15-git]
> <https://user-images.githubusercontent.com/15928203/86031085-128a1780-ba3e-11ea-8876-74531ac5b934.png>
>
>    - IntelliJ Idea: *File > New > Project ..*
>
> [image: intelliJ_Idea_new-project__0 15-git]
> <https://user-images.githubusercontent.com/15928203/86031610-bb387700-ba3e-11ea-9824-be352e449dfc.png>
> Qtile version
>
> latest Qtile git version 0.15.1.dev158+gfb45432b
> Configuration
>
> can be observed with default qtile configuration.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/qtile/qtile/issues/1794>, or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAF7VVZI6CKCGLT74WRQILLRZC7LRANCNFSM4OLMPTVA>
> .
>

Here you go!
```
WM_WINDOW_ROLE(STRING) = "gimp-image-new"
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 16784057
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DIALOG
_NET_WM_USER_TIME(CARDINAL) = 288975
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x1001ab8
WM_CLIENT_LEADER(WINDOW): window id # 0x1000001
_NET_WM_PID(CARDINAL) = 842
WM_LOCALE_NAME(STRING) = "en_GB.utf8"
WM_CLIENT_MACHINE(STRING) = "serzh-pc"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		user specified location: 0, 0
		program specified location: 0, 0
		program specified minimum size: 409 by 256
		program specified maximum size: 409 by 256
		window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "gimp", "Gimp"
WM_ICON_NAME(STRING) = "Create a New Image"
_NET_WM_ICON_NAME(UTF8_STRING) = "Create a New Image"
WM_NAME(STRING) = "Create a New Image"
_NET_WM_NAME(UTF8_STRING) = "Create a New Image"
```

![gimp__xprop](https://user-images.githubusercontent.com/15928203/86032732-7a416200-ba40-11ea-94c2-77f47e34f652.png)



Resolving patch:
diff --git a/libqtile/layout/floating.py b/libqtile/layout/floating.py
--- a/libqtile/layout/floating.py
+++ b/libqtile/layout/floating.py
@@ -209,36 +209,38 @@ def compute_client_position(self, client, screen):
         return above
 
     def configure(self, client, screen):
+        if client.has_focus:
+            bc = client.group.qtile.color_pixel(self.border_focus)
+        else:
+            bc = client.group.qtile.color_pixel(self.border_normal)
+
+        if client.maximized:
+            bw = self.max_border_width
+        elif client.fullscreen:
+            bw = self.fullscreen_border_width
+        else:
+            bw = self.border_width
+
         # 'sun-awt-X11-XWindowPeer' is a dropdown used in Java application,
         # don't reposition it anywhere, let Java app to control it
         cls = client.window.get_wm_class() or ''
         is_java_dropdown = 'sun-awt-X11-XWindowPeer' in cls
         if is_java_dropdown:
-            client.unhide()
+            client.user_placed_window_setup(bc, bw)
             return
 
         # similar to above but the X11 version, the client may have already
         # placed itself. let's respect that
         if client.has_user_set_position():
-            client.unhide()
+            client.user_placed_window_setup(bc, bw)
             return
 
         # ok, it's not java and the window itself didn't position it, but users
         # may still have asked us not to mess with it
         if self.no_reposition_match is not None and self.no_reposition_match.compare(client):
-            client.unhide()
+            client.user_placed_window_setup(bc, bw)
             return
 
-        if client.has_focus:
-            bc = client.group.qtile.color_pixel(self.border_focus)
-        else:
-            bc = client.group.qtile.color_pixel(self.border_normal)
-        if client.maximized:
-            bw = self.max_border_width
-        elif client.fullscreen:
-            bw = self.fullscreen_border_width
-        else:
-            bw = self.border_width
         above = False
 
         # We definitely have a screen here, so let's be sure we'll float on screen
diff --git a/libqtile/window.py b/libqtile/window.py
--- a/libqtile/window.py
+++ b/libqtile/window.py
@@ -442,10 +442,8 @@ def _reset_mask(self):
         )
 
     def place(self, x, y, width, height, borderwidth, bordercolor,
-              above=False, force=False, margin=None):
+              above=False, margin=None):
         """Places the window at the specified location with the given size.
-
-        If force is false, than it tries to obey hints
         """
 
         # TODO: self.x/y/height/width are updated BEFORE
@@ -499,6 +497,13 @@ def place(self, x, y, width, height, borderwidth, bordercolor,
         if bordercolor is not None:
             self.window.set_attribute(borderpixel=bordercolor)
 
+    def user_placed_window_setup(self, borderpixel, borderwidth):
+        self.borderwidth = borderwidth
+        self.bordercolor = borderpixel
+        self.window.set_attribute(borderpixel=borderpixel)
+        self.window.configure(borderwidth=borderwidth)
+        self.unhide()
+
     def send_configure_notify(self, x, y, width, height):
         """Send a synthetic ConfigureNotify"""
 


Test patch: