diff --git a/src/System/Tianbar.hs b/src/System/Tianbar.hs
--- a/src/System/Tianbar.hs
+++ b/src/System/Tianbar.hs
@@ -1,12 +1,14 @@
 module System.Tianbar where
 
 import Data.GI.Base
+import Data.Int
 import qualified Data.Text as T
 
 import GI.Gdk.Enums hiding (WindowTypeToplevel)
 import GI.Gdk.Objects.Display
+import GI.Gdk.Objects.Monitor
 import GI.Gdk.Objects.Screen
-import GI.Gdk.Structs.Rectangle
+import qualified GI.Gdk.Structs.Rectangle as R
 
 import GI.Gtk.Enums
 import qualified GI.Gtk.Functions as GtkFunctions
@@ -22,38 +24,44 @@
 import System.Tianbar.WebKit
 
 
-topStrut :: Rectangle -> IO StrutProperties
-topStrut rect = do
-    mX <- get rect rectangleX
-    mY <- get rect rectangleY
-    mW <- get rect rectangleWidth
-    let x = fromIntegral mX
-        w = fromIntegral mW - 1
-        h = barHeight + fromIntegral mY
-     in return (0, 0, h, 0, 0, 0, 0, 0, x, x + w, 0, 0)
-
+data Rectangle = Rectangle { rX :: Int32
+                           , rY :: Int32
+                           , rW :: Int32
+                           , rH :: Int32
+                           }
 
-sizeMainWindow :: Window -> IO ()
-sizeMainWindow window = do
+-- The rectangle Tianbar should occupy on the display
+tianbarRectangle :: IO Rectangle
+tianbarRectangle = do
     Just disp <- displayGetDefault
-    screen <- displayGetDefaultScreen disp
-    monitorSize <- screenGetMonitorGeometry screen (fromIntegral myMonitor)
+    Just monitor <- displayGetPrimaryMonitor disp
+    monitorSize <- monitorGetGeometry monitor
 
-    monitorX <- get monitorSize rectangleX
-    monitorY <- get monitorSize rectangleY
-    monitorW <- get monitorSize rectangleWidth
+    monitorX <- get monitorSize R.rectangleX
+    monitorY <- get monitorSize R.rectangleY
+    monitorW <- get monitorSize R.rectangleWidth
 
-    let windowX = monitorX
-    let windowY = monitorY
-    let windowWidth = fromIntegral monitorW
-    let windowHeight = fromIntegral barHeight
+    return $ Rectangle monitorX monitorY monitorW (fromIntegral barHeight)
 
-    windowSetDefaultSize window (fromIntegral monitorW) (fromIntegral barHeight)
-    windowMove window windowX windowY
-    windowResize window windowWidth windowHeight
 
-    strut <- topStrut monitorSize
-    setStrutProperties window strut
+topStrut :: Rectangle -> StrutProperties
+topStrut rect = (0, 0, barHeight, 0,
+                 0, 0,
+                 0, 0,
+                 xStart, xEnd,
+                 0, 0)
+    where xStart = fromIntegral $ rX rect
+          xEnd = fromIntegral $ rX rect + rW rect - 1
+
+
+sizeMainWindow :: Window -> IO ()
+sizeMainWindow window = do
+    size <- tianbarRectangle
+
+    windowSetDefaultSize window (rW size) (rH size)
+    windowMove window (rX size) (rY size)
+    windowResize window (rW size) (rH size)
+    setStrutProperties window (topStrut size)
 
 
 main :: IO ()
diff --git a/src/System/Tianbar/Configuration.hs b/src/System/Tianbar/Configuration.hs
--- a/src/System/Tianbar/Configuration.hs
+++ b/src/System/Tianbar/Configuration.hs
@@ -3,8 +3,5 @@
 appName :: String
 appName = "tianbar"
 
-myMonitor :: Int
-myMonitor = 0
-
 barHeight :: Int
 barHeight = 25
diff --git a/src/System/Tianbar/WebKit.hs b/src/System/Tianbar/WebKit.hs
--- a/src/System/Tianbar/WebKit.hs
+++ b/src/System/Tianbar/WebKit.hs
@@ -9,8 +9,6 @@
 import Data.GI.Base
 
 import GI.Gdk.Flags
-import GI.Gdk.Objects.Display
-import GI.Gdk.Objects.Screen
 import GI.Gdk.Structs.Geometry
 import GI.Gdk.Structs.Rectangle
 
@@ -163,13 +161,6 @@
     wv <- tianbarWebView
 
     _ <- onWidgetRealize wv $ loadIndexPage wv
-
-    Just disp <- displayGetDefault
-    screen <- displayGetDefaultScreen disp
-    monitorSize <- screenGetMonitorGeometry screen (fromIntegral myMonitor)
-    monitorW <- get monitorSize rectangleWidth
-
-    widgetSetSizeRequest wv (monitorW `div` 2) (fromIntegral barHeight)
 
     widgetShowAll wv
     toWidget wv
diff --git a/tianbar.cabal b/tianbar.cabal
--- a/tianbar.cabal
+++ b/tianbar.cabal
@@ -1,5 +1,5 @@
 name:                tianbar
-version:             1.2.3.0
+version:             1.2.4
 synopsis:            A desktop bar based on WebKit
 description:
   A desktop bar using WebKit for rendering as much as possible.
@@ -58,7 +58,7 @@
                      , unordered-containers
                      , utf8-string
                      , xdg-basedir
-  pkgconfig-depends:   gtk+-3.0
+  pkgconfig-depends:   gtk+-3.0 >= 3.22, webkit2gtk-4.0
   hs-source-dirs:      src
   main-is:             Main.hs
   other-modules:       System.Tianbar
