diff options
author | mezz <mezz@FreeBSD.org> | 2008-11-26 08:08:01 +0800 |
---|---|---|
committer | mezz <mezz@FreeBSD.org> | 2008-11-26 08:08:01 +0800 |
commit | 81eef2308eac7bb575bbaab0effed500122d64cc (patch) | |
tree | 63db5161e59abff983f0a4c4848972f61ddfdd1d /x11-wm | |
parent | f2dc6711c696f8df04a6efcdf27b7e24b0373a10 (diff) | |
download | freebsd-ports-gnome-81eef2308eac7bb575bbaab0effed500122d64cc.tar.gz freebsd-ports-gnome-81eef2308eac7bb575bbaab0effed500122d64cc.tar.zst freebsd-ports-gnome-81eef2308eac7bb575bbaab0effed500122d64cc.zip |
-patch-aaa0[05] fix focus issues
-patch-aaa0[13] contain changes required for patch-aaa0[67]
-patch-aaa0[67] fix `resize to negative dimension` bug
-Bump the PORTREVISION.
Submitted by: Alexander <flitster@gmail.com>
Obtained from: Its git
Diffstat (limited to 'x11-wm')
-rw-r--r-- | x11-wm/fluxbox/Makefile | 2 | ||||
-rw-r--r-- | x11-wm/fluxbox/files/patch-aaa00 | 10 | ||||
-rw-r--r-- | x11-wm/fluxbox/files/patch-aaa01 | 160 | ||||
-rw-r--r-- | x11-wm/fluxbox/files/patch-aaa03 | 54 | ||||
-rw-r--r-- | x11-wm/fluxbox/files/patch-aaa05 | 27 | ||||
-rw-r--r-- | x11-wm/fluxbox/files/patch-aaa06 | 162 | ||||
-rw-r--r-- | x11-wm/fluxbox/files/patch-aaa07 | 30 |
7 files changed, 444 insertions, 1 deletions
diff --git a/x11-wm/fluxbox/Makefile b/x11-wm/fluxbox/Makefile index dafbb0dcc66c..607707ca0737 100644 --- a/x11-wm/fluxbox/Makefile +++ b/x11-wm/fluxbox/Makefile @@ -7,7 +7,7 @@ PORTNAME= fluxbox PORTVERSION= 1.1.0.1 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= x11-wm MASTER_SITES= SF DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} diff --git a/x11-wm/fluxbox/files/patch-aaa00 b/x11-wm/fluxbox/files/patch-aaa00 new file mode 100644 index 000000000000..1b01d73e6e35 --- /dev/null +++ b/x11-wm/fluxbox/files/patch-aaa00 @@ -0,0 +1,10 @@ +--- src/fluxbox.cc.orig ++++ src/fluxbox.cc +@@ -825,6 +825,7 @@ void Fluxbox::handleEvent(XEvent * const e) { + // a grab is something of a pseudo-focus event, so we ignore + // them, here we ignore some window receiving it + if (e->xfocus.mode == NotifyGrab || ++ e->xfocus.mode == NotifyUngrab || + e->xfocus.detail == NotifyPointer || + e->xfocus.detail == NotifyInferior) + break; diff --git a/x11-wm/fluxbox/files/patch-aaa01 b/x11-wm/fluxbox/files/patch-aaa01 new file mode 100644 index 000000000000..a2e5d1bac851 --- /dev/null +++ b/x11-wm/fluxbox/files/patch-aaa01 @@ -0,0 +1,160 @@ +From: Henrik Kinnunen <fluxgen@fluxbox.org> +Date: Sun, 14 Sep 2008 18:06:28 +0000 (+0200) +Subject: some minor code cleaning. +X-Git-Tag: Release-1_1_1~4 +X-Git-Url: http://git.fluxbox.org/?p=fluxbox.git;a=commitdiff_plain;h=9f519ec0fcb7cd0dec61a4c31d246800f9a73cb3 + +some minor code cleaning. +--- + +diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc +index 5b91218..fc35ae1 100644 +--- a/src/FbWinFrame.cc ++++ src/FbWinFrame.cc +@@ -1717,3 +1717,10 @@ void FbWinFrame::displaySize(unsigned int width, unsigned int height) const { + width, height - titlebarHeight() - handleHeight()); + m_screen.showGeometry(i, j); + } ++ ++bool FbWinFrame::insideTitlebar(Window win) const { ++ return ++ gripLeft().window() != win && ++ gripRight().window() != win && ++ window().window() != win; ++} +diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh +index fcbe11e..ff9c19e 100644 +--- a/src/FbWinFrame.hh ++++ src/FbWinFrame.hh +@@ -236,6 +236,9 @@ public: + + const FbTk::Subject &frameExtentSig() const { return m_frame_extent_sig; } + FbTk::Subject &frameExtentSig() { return m_frame_extent_sig; } ++ /// @returns true if the window is inside titlebar, ++ /// assuming window is an event window that was generated for this frame. ++ bool insideTitlebar(Window win) const; + + //@} + +diff --git a/src/RectangleUtil.hh b/src/RectangleUtil.hh +new file mode 100644 +index 0000000..88c3a33 +--- /dev/null ++++ src/RectangleUtil.hh +@@ -0,0 +1,30 @@ ++#ifndef RECTANGLEUTIL_HH ++#define RECTANGLEUTIL_HH ++ ++namespace RectangleUtil { ++ ++ ++/* ++ * Determines if a point is inside a rectangle-like objects border. ++ * @param rect A rectangle-like object that has accessors for x, y, width, and ++ * height. ++ * @param x ++ * @param y ++ * @param border_width The size of the border. ++ * @returns true if point is inside the rectangle-like object. ++*/ ++template <typename RectangleLike> ++bool insideBorder(const RectangleLike& rect, ++ int x, int y, ++ int border_width) { ++ return ++ x >= rect.x() + border_width && ++ x < rect.x() + (int)rect.width() + border_width && ++ y >= rect.y() + border_width && ++ y < rect.y() + (int)rect.height() + border_width; ++} ++ ++} // namespace RectangleUtil ++ ++ ++#endif // RECTANGLEUTIL_HH +diff --git a/src/Window.cc b/src/Window.cc +index 16334c6..5d50fcf 100644 +--- a/src/Window.cc ++++ src/Window.cc +@@ -41,6 +41,7 @@ + #include "FocusControl.hh" + #include "IconButton.hh" + #include "ScreenPlacement.hh" ++#include "RectangleUtil.hh" + + #include "FbTk/StringUtil.hh" + #include "FbTk/Compose.hh" +@@ -2362,10 +2363,9 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) { + m_last_button_x = be.x_root; + m_last_button_y = be.y_root; + +- bool onTitlebar = frame().gripLeft().window() != be.window && +- frame().gripRight().window() != be.window && +- frame().handle().window() != be.window && +- frame().window() != be.window; ++ bool onTitlebar = ++ frame().insideTitlebar( be.window ) && ++ frame().handle().window() != be.window; + + if (onTitlebar && be.button == 1) + raise(); +@@ -2422,41 +2422,31 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) { + me.window = frame().window().window(); + } + +- bool inside_titlebar = frame().gripLeft().window() != me.window && +- frame().gripRight().window() != me.window && +- frame().window() != me.window; ++ bool inside_titlebar = frame().insideTitlebar( me.window ); + + if (Fluxbox::instance()->getIgnoreBorder() && m_attaching_tab == 0 + && !(isMoving() || isResizing())) { ++ ++ using RectangleUtil::insideBorder; ++ + int borderw = frame().window().borderWidth(); + //!! TODO(tabs): the below test ought to be in FbWinFrame + // if mouse is currently on the window border, ignore it +- if ((me.x_root < (frame().x() + borderw) || +- me.y_root < (frame().y() + borderw) || +- me.x_root >= (frame().x() + (int)frame().width() + borderw) || +- me.y_root >= (frame().y() + (int)frame().height() + borderw)) +- && (!frame().externalTabMode() || +- (me.x_root < (frame().tabcontainer().x() + borderw) || +- me.y_root < (frame().tabcontainer().y() + borderw) || +- me.x_root >= (frame().tabcontainer().x() + +- (int)frame().tabcontainer().width() + borderw) || +- me.y_root >= (frame().tabcontainer().y() + +- (int)frame().tabcontainer().height() + borderw))) +- // or if mouse was on border when it was last clicked +- || (m_last_button_x < (frame().x() + borderw) || +- m_last_button_y < (frame().y() + borderw) || +- m_last_button_x >= (frame().x() + +- (int)frame().width() + borderw) || +- m_last_button_y >= (frame().y() + +- (int)frame().height() + borderw)) +- && (!frame().externalTabMode() || +- (m_last_button_x < (frame().tabcontainer().x() + borderw) || +- m_last_button_y < (frame().tabcontainer().y() + borderw) || +- m_last_button_x >= (frame().tabcontainer().x() + +- (int)frame().tabcontainer().width() + borderw) || +- m_last_button_y >= (frame().tabcontainer().y() + +- (int)frame().tabcontainer().height() + borderw)))) ++ if ( ! insideBorder(frame(), ++ me.x_root, me.y_root, borderw) && ++ ( !frame().externalTabMode() || ++ ! insideBorder(frame().tabcontainer(), ++ me.x_root, me.y_root, borderw) ) ++ ++ || // or if mouse was on border when it was last clicked ++ ++ ! insideBorder(frame(), ++ m_last_button_x, m_last_button_y, borderw) && ++ ( ! frame().externalTabMode() || ++ ! insideBorder(frame().tabcontainer(), ++ m_last_button_x, m_last_button_y, borderw ) ) ) { + return; ++ } + } + + if (moving || ((me.state & Button1Mask) && functions.move && diff --git a/x11-wm/fluxbox/files/patch-aaa03 b/x11-wm/fluxbox/files/patch-aaa03 new file mode 100644 index 000000000000..636d6eba0b20 --- /dev/null +++ b/x11-wm/fluxbox/files/patch-aaa03 @@ -0,0 +1,54 @@ +From: Henrik Kinnunen <fluxgen@fluxbox.org> +Date: Sun, 14 Sep 2008 19:46:36 +0000 (+0200) +Subject: added RectangleUtil.hh to build +X-Git-Tag: Release-1_1_1~2 +X-Git-Url: http://git.fluxbox.org/?p=fluxbox.git;a=commitdiff_plain;h=a4feddcbd63a4eca37ea3c1641daee25ed9a4c28 + +added RectangleUtil.hh to build +--- + +diff --git a/src/Makefile.am b/src/Makefile.am +index ce591d5..cfc06b3 100644 +--- a/src/Makefile.am ++++ src/Makefile.am +@@ -151,6 +151,7 @@ fluxbox_SOURCES = AtomHandler.hh ArrowButton.hh ArrowButton.cc \ + IconbarTheme.hh IconbarTheme.cc \ + Focusable.hh FocusableList.hh FocusableList.cc FocusableTheme.hh \ + WindowMenuAccessor.hh \ ++ RectangleUtil.hh \ + ${newwmspec_SOURCE} ${gnome_SOURCE} \ + ${REMEMBER_SOURCE} ${TOOLBAR_SOURCE} + +--- src/Makefile.in 2008-09-03 22:44:02.000000000 +0400 ++++ src/Makefile.in 2008-11-20 03:54:38.000000000 +0300 +@@ -98,10 +98,10 @@ + AttentionNoticeHandler.cc IconButton.hh IconButton.cc \ + IconbarTheme.hh IconbarTheme.cc Focusable.hh FocusableList.hh \ + FocusableList.cc FocusableTheme.hh WindowMenuAccessor.hh \ +- Ewmh.hh Ewmh.cc Gnome.hh Gnome.cc Remember.hh Remember.cc \ +- ClientPattern.hh ClientPattern.cc Toolbar.hh Toolbar.cc \ +- ToolbarTheme.hh ToolbarTheme.cc ToolbarItem.hh ToolbarItem.cc \ +- ClockTool.hh ClockTool.cc WorkspaceNameTool.hh \ ++ RectangleUtil.hh Ewmh.hh Ewmh.cc Gnome.hh Gnome.cc Remember.hh \ ++ Remember.cc ClientPattern.hh ClientPattern.cc Toolbar.hh \ ++ Toolbar.cc ToolbarTheme.hh ToolbarTheme.cc ToolbarItem.hh \ ++ ToolbarItem.cc ClockTool.hh ClockTool.cc WorkspaceNameTool.hh \ + WorkspaceNameTool.cc WorkspaceNameTheme.hh IconbarTool.hh \ + IconbarTool.cc ToolTheme.hh ToolTheme.cc SystemTray.hh \ + SystemTray.cc GenericTool.hh GenericTool.cc ButtonTool.hh \ +@@ -285,6 +285,7 @@ + srcdir = @srcdir@ + sysconfdir = @sysconfdir@ + target_alias = @target_alias@ ++top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + SUBDIRS = FbTk +@@ -363,6 +364,7 @@ + IconbarTheme.hh IconbarTheme.cc \ + Focusable.hh FocusableList.hh FocusableList.cc FocusableTheme.hh \ + WindowMenuAccessor.hh \ ++ RectangleUtil.hh \ + ${newwmspec_SOURCE} ${gnome_SOURCE} \ + ${REMEMBER_SOURCE} ${TOOLBAR_SOURCE} + diff --git a/x11-wm/fluxbox/files/patch-aaa05 b/x11-wm/fluxbox/files/patch-aaa05 new file mode 100644 index 000000000000..ada823f49861 --- /dev/null +++ b/x11-wm/fluxbox/files/patch-aaa05 @@ -0,0 +1,27 @@ +From: Mark Tiefenbruck <mark@fluxbox.org> +Date: Sun, 12 Oct 2008 16:54:35 +0000 (-0700) +Subject: focus window when done dragging to a new workspace with outline moving +X-Git-Url: http://git.fluxbox.org/?p=fluxbox.git;a=commitdiff_plain;h=e5fd401f4eadef1aa4ab91b11d38653d1a4b7194 + +focus window when done dragging to a new workspace with outline moving +--- + +diff --git a/src/Window.cc b/src/Window.cc +index e29e761..d23bf44 100644 +--- a/src/Window.cc ++++ src/Window.cc +@@ -2861,11 +2861,9 @@ void FluxboxWindow::stopMoving(bool interrupted) { + frame().height() + 2*frame().window().borderWidth()-1); + if (!interrupted) { + moveResize(m_last_move_x, m_last_move_y, frame().width(), frame().height()); +- if (m_workspace_number != screen().currentWorkspaceID()) { +- screen().reassociateWindow(this, screen().currentWorkspaceID(), true); +- frame().show(); +- focus(); +- } ++ if (m_workspace_number != screen().currentWorkspaceID()) ++ screen().sendToWorkspace(screen().currentWorkspaceID(), this); ++ focus(); + } + fluxbox->ungrab(); + } else if (!interrupted) { diff --git a/x11-wm/fluxbox/files/patch-aaa06 b/x11-wm/fluxbox/files/patch-aaa06 new file mode 100644 index 000000000000..7a142894d012 --- /dev/null +++ b/x11-wm/fluxbox/files/patch-aaa06 @@ -0,0 +1,162 @@ +From: Mathias Gumz <akira at fluxbox dot org> +Date: Wed, 15 Oct 2008 06:31:10 +0000 (+0200) +Subject: don't allow resizing to negative dimensions +X-Git-Url: http://git.fluxbox.org/?p=fluxbox.git;a=commitdiff_plain;h=3441261346fcee4efb6ba27764384d141b2c4f7e + +don't allow resizing to negative dimensions + +this fixes a problem when the user resizes a window over the opposite border. +as a result a signed overflow occured which lead to quite huge windows. +--- + +diff --git a/ChangeLog b/ChangeLog +index 5eeda89..67ee11d 100644 +--- a/ChangeLog ++++ ChangeLog +@@ -1,5 +1,8 @@ + (Format: Year/Month/Day) + Changes for 1.1 ++ *08/10/15: ++ * Don't allow resizing to negative dimensions (Mathias) ++ Window.cc/hh + *08/09/01: + * When the current menu item gets disabled, highlight its nearest neighbor + and add separators to the focus model menu (Mark) +diff --git a/src/Window.cc b/src/Window.cc +index d23bf44..4b4d1dc 100644 +--- a/src/Window.cc ++++ src/Window.cc +@@ -2433,19 +2433,15 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) { + int borderw = frame().window().borderWidth(); + //!! TODO(tabs): the below test ought to be in FbWinFrame + // if mouse is currently on the window border, ignore it +- if ( ! insideBorder(frame(), +- me.x_root, me.y_root, borderw) && ++ if ( ! insideBorder(frame(), me.x_root, me.y_root, borderw) && + ( !frame().externalTabMode() || +- ! insideBorder(frame().tabcontainer(), +- me.x_root, me.y_root, borderw) ) ++ ! insideBorder(frame().tabcontainer(), me.x_root, me.y_root, borderw) ) + + || // or if mouse was on border when it was last clicked + +- ! insideBorder(frame(), +- m_last_button_x, m_last_button_y, borderw) && ++ ! insideBorder(frame(), m_last_button_x, m_last_button_y, borderw) && + ( ! frame().externalTabMode() || +- ! insideBorder(frame().tabcontainer(), +- m_last_button_x, m_last_button_y, borderw ) ) ) { ++ ! insideBorder(frame().tabcontainer(), m_last_button_x, m_last_button_y, borderw ) ) ) { + return; + } + } +@@ -2563,11 +2559,12 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) { + + int old_resize_x = m_last_resize_x; + int old_resize_y = m_last_resize_y; +- unsigned int old_resize_w = m_last_resize_w; +- unsigned int old_resize_h = m_last_resize_h; ++ int old_resize_w = m_last_resize_w; ++ int old_resize_h = m_last_resize_h; + + int dx = me.x - m_button_grab_x; + int dy = me.y - m_button_grab_y; ++ + if (m_resize_corner == LEFTTOP || m_resize_corner == LEFTBOTTOM || + m_resize_corner == LEFT) { + m_last_resize_w = frame().width() - dx; +@@ -2598,7 +2595,7 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) { + } + } + +- fixsize(); ++ fixSize(); + frame().displaySize(m_last_resize_w, m_last_resize_h); + + if (old_resize_x != m_last_resize_x || +@@ -3107,7 +3104,7 @@ void FluxboxWindow::startResizing(int x, int y, ReferenceCorner dir) { + m_last_resize_w = frame().width(); + m_last_resize_h = frame().height(); + +- fixsize(); ++ fixSize(); + frame().displaySize(m_last_resize_w, m_last_resize_h); + + parent().drawRectangle(screen().rootTheme()->opGC(), +@@ -3127,7 +3124,7 @@ void FluxboxWindow::stopResizing(bool interrupted) { + screen().hideGeometry(); + + if (!interrupted) { +- fixsize(); ++ fixSize(); + + moveResize(m_last_resize_x, m_last_resize_y, + m_last_resize_w, m_last_resize_h); +@@ -3375,8 +3372,21 @@ bool FluxboxWindow::isTransient() const { + + int FluxboxWindow::initialState() const { return m_client->initial_state; } + +-void FluxboxWindow::fixsize() { +- frame().applySizeHints(m_last_resize_w, m_last_resize_h); ++void FluxboxWindow::fixSize() { ++ ++ // m_last_resize_w / m_last_resize_h could be negative ++ // due to user interactions. check here and limit ++ unsigned int w = 1; ++ unsigned int h = 1; ++ if (m_last_resize_w > 0) ++ w = m_last_resize_w; ++ if (m_last_resize_h > 0) ++ h = m_last_resize_h; ++ ++ frame().applySizeHints(w, h); ++ ++ m_last_resize_w = w; ++ m_last_resize_h = h; + + // move X if necessary + if (m_resize_corner == LEFTTOP || m_resize_corner == LEFTBOTTOM || +diff --git a/src/Window.hh b/src/Window.hh +index 97ece55..bf177b4 100644 +--- a/src/Window.hh ++++ src/Window.hh +@@ -507,7 +507,7 @@ private: + // modifies left and top if snap is necessary + void doSnapping(int &left, int &top); + // user_w/h return the values that should be shown to the user +- void fixsize(); ++ void fixSize(); + void moveResizeClient(WinClient &client); + /// sends configurenotify to all clients + void sendConfigureNotify(); +@@ -547,7 +547,7 @@ private: + int m_button_grab_x, m_button_grab_y; // handles last button press event for move + int m_last_resize_x, m_last_resize_y; // handles last button press event for resize + int m_last_move_x, m_last_move_y; // handles last pos for non opaque moving +- unsigned int m_last_resize_h, m_last_resize_w; // handles height/width for resize "window" ++ int m_last_resize_h, m_last_resize_w; // handles height/width for resize "window" + + timeval m_last_keypress_time; + +@@ -562,16 +562,16 @@ private: + Client2ButtonMap m_labelbuttons; + + SizeHints m_size_hint; +- struct _decorations { +- bool titlebar, handle, border, iconify, +- maximize, close, menu, sticky, shade, tab, enabled; ++ struct { ++ bool titlebar:1, handle:1, border:1, iconify:1, ++ maximize:1, close:1, menu:1, sticky:1, shade:1, tab:1, enabled:1; + } decorations; + + std::vector<WinButton::Type> m_titlebar_buttons[2]; + bool m_toggled_decos; + +- struct _functions { +- bool resize, move, iconify, maximize, close, tabable; ++ struct { ++ bool resize:1, move:1, iconify:1, maximize:1, close:1, tabable:1; + } functions; + + typedef FbTk::ConstObjectAccessor<bool, FocusControl> BoolAcc; diff --git a/x11-wm/fluxbox/files/patch-aaa07 b/x11-wm/fluxbox/files/patch-aaa07 new file mode 100644 index 000000000000..61d22624bd19 --- /dev/null +++ b/x11-wm/fluxbox/files/patch-aaa07 @@ -0,0 +1,30 @@ +From: Mathias Gumz <akira at fluxbox dot org> +Date: Wed, 15 Oct 2008 21:31:37 +0000 (+0200) +Subject: additional fix for the resize bug +X-Git-Url: http://git.fluxbox.org/?p=fluxbox.git;a=commitdiff_plain;h=6642792f68ae42ba8d2bcbe2033284f7e8e61167 + +additional fix for the resize bug +--- + +diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc +index ce25004..711e993 100644 +--- a/src/FbWinFrame.cc ++++ src/FbWinFrame.cc +@@ -38,6 +38,7 @@ + #include <algorithm> + #include <X11/X.h> + ++using std::max; + using std::mem_fun; + using std::string; + +@@ -1702,7 +1703,8 @@ int FbWinFrame::yOffset() const { + + void FbWinFrame::applySizeHints(unsigned int &width, unsigned int &height, + bool maximizing) const { +- height -= titlebarHeight() + handleHeight(); ++ const int h = height - titlebarHeight() + handleHeight(); ++ height = max(h, static_cast<int>(titlebarHeight() + handleHeight())); + sizeHints().apply(width, height, maximizing); + height += titlebarHeight() + handleHeight(); + } |