gnome-shell/js/ui
Jonas Dreßler 1a27ff6130 search: Fix calculation of max number of displayed results for grid
The calculation of how many results can be shown in GridSearchResults is
broken: The width of the parent container (resultsView.actor) we're
using as the maximum width right now is the width of the scrollView of
SearchResults (which always expands to the whole screen size). This
width will only be correct if the scrollView (ie. the whole screen) is
smaller than the max width of searchResultsContent, which only is the
case for screens smaller than 1000px.

To fix the calculation, use the width of our own actor and don't get it
using clutter_actor_get_width(), but using the last allocation of the
actor. This way we don't get the preferred width if the actor is not
allocated at this point (it's hidden by _ensureProviderDisplay() when
starting a new search).

Then, when the allocation of the actor changes, rebuild the grid search
results by calling updateSearch() with the old arguments to ensure the
number of visible results is correct. The fact that we're only listening
for allocation changes here is the reason why we never want to use the
preferred width of the actor inside _getMaxDisplayedResults(): While
the actor is hidden clutter_actor_get_width() would return the preferred
width, which we'd then use the as the maximum width. But if the actor
had a correct allocation before, no notify::allocation signal will be
emitted when the actor is shown again because the allocation is still
the same, and we'll end up using the preferred width as maximium width
forever.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/110
2019-07-15 23:00:34 +00:00
..
components cleanup: Use default parameters where appropriate 2019-07-12 18:54:49 +00:00
status power: Use more fine-grained battery levels 2019-07-12 23:24:35 +02:00
accessDialog.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
altTab.js style: Stop using braces for single-line arrow functions 2019-07-02 12:17:46 +00:00
animation.js style: Use camelCase for variable names 2019-07-01 23:44:11 +02:00
appDisplay.js cleanup: Use default parameters where appropriate 2019-07-12 18:54:49 +00:00
appFavorites.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
audioDeviceSelection.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
background.js style: Fix indentation errors 2019-07-02 12:17:46 +00:00
backgroundMenu.js popupMenu: Make MenuManager to take an actor as parameter 2019-04-17 21:32:18 +00:00
barLevel.js cleanup: Use default parameters where appropriate 2019-07-12 18:54:49 +00:00
boxpointer.js cleanup: Use consistent switch indentation 2019-07-02 12:17:46 +00:00
calendar.js calendar: Simplify code a bit 2019-07-12 18:54:49 +00:00
checkBox.js cleanup: Use destructuring for imports from GI 2019-02-09 07:39:20 +01:00
closeDialog.js style: Fix stray/missing spaces 2019-07-01 23:44:11 +02:00
ctrlAltTab.js style: Stop using braces for single-line arrow functions 2019-07-02 12:17:46 +00:00
dash.js style: Fix indentation errors 2019-07-02 12:17:46 +00:00
dateMenu.js style: Stop using braces for single-line arrow functions 2019-07-02 12:17:46 +00:00
dialog.js dialog: Use Object.assign() for default property value 2019-07-12 18:54:49 +00:00
dnd.js cleanup: Use arrow functions for tweener callbacks 2019-07-02 12:17:46 +00:00
edgeDragAction.js style: Stop using braces for single-line arrow functions 2019-07-02 12:17:46 +00:00
endSessionDialog.js cleanup: Fix style nits in last commit 2019-07-08 20:15:15 +02:00
environment.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
extensionDownloader.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
extensionSystem.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
focusCaretTracker.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
grabHelper.js cleanup: Use Array.includes() to check for element existence 2019-07-01 21:28:52 +00:00
ibusCandidatePopup.js style: Fix indentation errors 2019-07-02 12:17:46 +00:00
iconGrid.js style: Stop using braces for single-line arrow functions 2019-07-02 12:17:46 +00:00
inhibitShortcutsDialog.js cleanup: Use Array.includes() to check for element existence 2019-07-01 21:28:52 +00:00
kbdA11yDialog.js cleanup: Use destructuring for imports from GI 2019-02-09 07:39:20 +01:00
keyboard.js style: Stop using braces for single-line arrow functions 2019-07-02 12:17:46 +00:00
layout.js cleanup: Use default parameters where appropriate 2019-07-12 18:54:49 +00:00
lightbox.js Theme: update to sync with gtk Adwaita 2019-06-21 10:44:08 +02:00
locatePointer.js style: Fix stray/missing spaces 2019-07-01 23:44:11 +02:00
lookingGlass.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
magnifier.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
magnifierDBus.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
main.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
messageList.js cleanup: Use default parameters where appropriate 2019-07-12 18:54:49 +00:00
messageTray.js cleanup: Use default parameters where appropriate 2019-07-12 18:54:49 +00:00
modalDialog.js cleanup: Use consistent style for GObject property definitions 2019-07-02 12:17:46 +00:00
mpris.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
notificationDaemon.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
osdMonitorLabeler.js style: Fix indentation errors 2019-07-02 12:17:46 +00:00
osdWindow.js cleanup: Use default parameters where appropriate 2019-07-12 18:54:49 +00:00
overview.js style: Fix indentation errors 2019-07-02 12:17:46 +00:00
overviewControls.js style: Fix indentation errors 2019-07-02 12:17:46 +00:00
padOsd.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
pageIndicators.js cleanup: Use destructuring for imports from GI 2019-02-09 07:39:20 +01:00
panel.js cleanup: Use default parameters where appropriate 2019-07-12 18:54:49 +00:00
panelMenu.js style: Fix stray/missing spaces 2019-07-01 23:44:11 +02:00
pointerA11yTimeout.js style: Fix indentation errors 2019-07-02 12:17:46 +00:00
pointerWatcher.js cleanup: Use destructuring for imports from GI 2019-02-09 07:39:20 +01:00
popupMenu.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
remoteSearch.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
ripples.js cleanup: Use arrow functions for tweener callbacks 2019-07-02 12:17:46 +00:00
runDialog.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
screencast.js cleanup: Use destructuring for imports from GI 2019-02-09 07:39:20 +01:00
screenShield.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
screenshot.js style: Fix indentation errors 2019-07-02 12:17:46 +00:00
scripting.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
search.js search: Fix calculation of max number of displayed results for grid 2019-07-15 23:00:34 +00:00
sessionMode.js style: Use space after catch 2019-07-01 23:44:11 +02:00
shellDBus.js shellDBus: Rename ShowMonitorLabels2 to ShowMonitorLabels 2019-07-15 11:18:29 +02:00
shellEntry.js style: Stop using braces for single-line arrow functions 2019-07-02 12:17:46 +00:00
shellMountOperation.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
slider.js style: Fix stray/missing semi-colons 2019-07-01 23:44:11 +02:00
switcherPopup.js style: Stop using braces for single-line arrow functions 2019-07-02 12:17:46 +00:00
switchMonitor.js style: Fix stray/missing spaces 2019-07-01 23:44:11 +02:00
tweener.js cleanup: Prefer template strings 2019-07-05 11:32:31 +00:00
unlockDialog.js cleanup: Use destructuring for imports from GI 2019-02-09 07:39:20 +01:00
userWidget.js cleanup: Remove unused variables 2019-07-01 23:44:10 +02:00
viewSelector.js style: Fix indentation errors 2019-07-02 12:17:46 +00:00
windowAttentionHandler.js style: Stop using braces for single-line arrow functions 2019-07-02 12:17:46 +00:00
windowManager.js windowManager: Remove unused property 2019-07-09 14:46:36 +02:00
windowMenu.js sessionMode: add a property to disable window manager menus 2019-06-06 01:25:04 +00:00
workspace.js workspace: Set offscreen redirect on window previews 2019-07-10 21:41:58 +00:00
workspacesView.js workspacesView: Work around spurious allocation changes 2019-07-12 16:48:03 +02:00
workspaceSwitcherPopup.js style: Fix indentation errors 2019-07-02 12:17:46 +00:00
workspaceThumbnail.js workspaceThumbnails: Handle reordering of workspaces 2019-07-09 14:41:35 +02:00
xdndHandler.js shell: Drop XDND initialization code 2019-07-03 16:37:15 +02:00